
$(document).ready(function(){
	setupMenu();
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({sSelector:"body h2", sFlashSrc:"http://www.parcoinc.com/HelveticaNeue.swf", sColor:"#222834", sLinkColor:"#222834", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent"}));
		sIFR.replaceElement(named({sSelector:"#sub-content h1", sFlashSrc:"http://www.parcoinc.com/HelveticaNeue.swf", sColor:"#222834", sLinkColor:"#222834", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0,sWmode:"transparent"}));
	};
	
	$('#top_menu ul li').hover(function() {
		$(this).addClass("selected");
	}, function() {
		$(this).removeClass("selected");
	});	
	
});

function setupMenu() {
	$('div#menu ul li').hover(function() {
		$('ul#' + $(this).attr('id') + '-menu').show();
	}, function() {
		$('ul#' + $(this).attr('id') + '-menu').hide();
	});
	$('div#submenus ul').hover(function() { $(this).show(); }, function() { $(this).hide(); });
	$('div#submenus ul ul').hover(function() { $(this).show(); }, function() { $(this).show(); });	
}

function toggleSelected(el){
	alert(el);
}

function clearSearch(el){
	if(el.value == 'Search'){
		el.value = '';	
	}
}

function goTo(url) {
	window.location = url;
}

function showTable(tbl) {
	$('div#size table').hide();
	$('#'+tbl).show();
}

function printSpecial()
{
	var gAutoPrint = false;
	
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';
		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		html += '\n</HE' + 'AD>\n<BODY class="print"><form><p class="print_button" align="center"><a href="javascript:window.print()"><img src="http://www.parcoinc.com/images/print_page.gif" alt="Print This Page" /></a></p></form><div class="print_area"><img src="http://72.47.213.39/images/logo.jpg" alt="Parco Logo" hspace="12">\n';
		
		var printReadyElem = document.getElementById("content");
		
		if (printReadyElem != null)
		{
				html += printReadyElem.innerHTML;
		}
		else
		{
			alert("Could not find the printReady section in the HTML");
			return;
		}
			
		html += '\n</div><form><p class="print_button" align="center"><a href="javascript:window.print()"><img src="http://www.parcoinc.com/images/print_page.gif" alt="Print This Page" /></a></p></form></BO' + 'DY>\n</HT' + 'ML>';
		
		var win = null;
		LeftPosition = (screen.width) ? (screen.width-650)/2 : 0;
		TopPosition = (screen.height) ? (screen.height-600)/2 : 0;
		settings = 'height=600,width=650,top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,resizable,menubar=1';
		printWin = window.open("","printSpecial",settings)
		
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)	printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}

function clearDefault(el) {
  if (el.defaultValue==el.value) el.value = ""
}

function openPopup(url, width, height, callback) {
   newwindow=window.open(url,'name','height=400, width=400, resizable');
	if (window.focus) {newwindow.focus()}
}


/*function TrimString (inputString)
{
   var workString = inputString;

   while (workString.substring(0, 1) == ' ')
   {
      workString = workString.substring(1);
   }

   while (workString.substring((workString.length - 1), workString.length) == ' ')
   {
      workString = workString.substring(0, (workString.length - 1));
   }

   return workString;
}

function ValidateForm ()
{

   if (TrimString(document.LiteratureForm.FirstName.value).length == 0)
   {
      alert('Please enter your first name.');
      document.LiteratureForm.FirstName.focus();
      return false;
   }
   else if (TrimString(document.LiteratureForm.LastName.value).length == 0)
   {
      alert('Please enter your last name.');
      document.LiteratureForm.LastName.focus();
      return false;
   }
   else if (TrimString(document.LiteratureForm.State.value).length == 0)
   {
      alert('Please select the state in which you work.');
      document.LiteratureForm.State.focus();
      return false;
   }
   else if (TrimString(document.LiteratureForm.Phone.value).length == 0)
   {
      alert('Please select the state in which you work.');
      document.LiteratureForm.State.focus();
      return false;
   }
   else
   {
      return true;
   }

}*/