
function showHelper(id,inout) {
	document.getElementById(id).style.visibility = inout ? "visible" : "hidden";
	document.getElementById(id).style.display = inout ? "block" : "none";
}

function dealer_locate(form,state) {
	if(state.value == "") { // If no state has been selected go to dealer locator
	
		form.action = "http://stats.manticoretechnology.com/LogVisit.asp?ID=2711&UserID=97C5B603-ED8A-462F-8C77-FF66874DA82F&ra=1142030900390&pn=http%3A//www.internationaldelivers.com/site_layout/dealers/locator.asp&rp=&sr=&cd=&tz=&ci=1&je=1&cc=&sg=&ip=&pc=&pt=Dealer%20Locator&af=&ea=&cp=&epci=&vd=L3%3A{EmailAddress}&o_pce=30&o_pcsl=0&ml=1&rd=1";
	} else {
		form.action = "http://evalue.internationaldelivers.com/dealernetwork/dealerlist.asp";
	}
	form.target = "_blank";
}
var popUpWindow = null;
function showPopUp(file, w, h, allowscroll) {
  if(popUpWindow){ popUpWindow.close(); }
  LeftPos=(screen.width) ? (screen.width-w)/2 : 0;
  TopPos=(screen.height) ? (screen.height-h)/2 : 0;
  popUpWindow = window.open(file,"","scrollbars="+allowscroll+",height="+h+",width="+w+",top="+TopPos+",left="+LeftPos+"");
  popUpWindow.focus();
}
function ShowContactDivs(selectBox)  {
	window.document.getElementById("divPhone").style.visibility = (selectBox.selectedIndex == 1) ? "visible" : "hidden";
	window.document.getElementById("divPhone").style.display = (selectBox.selectedIndex == 1) ? "block" : "none";
	window.document.getElementById("divAddress").style.visibility = (selectBox.selectedIndex == 2 ) ? "visible" : "hidden";
	window.document.getElementById("divAddress").style.display = (selectBox.selectedIndex == 2) ? "block" : "none";
}
function ShowQuestionDivs(selectBox) {
	window.document.getElementById("qSetYes").style.visibility = (selectBox.selectedIndex == 1) ? "visible" : "hidden";
	window.document.getElementById("qSetYes").style.display = (selectBox.selectedIndex == 1) ? "block" : "none";
	window.document.getElementById("qSetNo").style.visibility = (selectBox.selectedIndex == 2) ? "visible" : "hidden";
	window.document.getElementById("qSetNo").style.display = (selectBox.selectedIndex == 2) ? "block" : "none";
	
	ShowRetailMethod(selectBox.selectedIndex == 1 && document.forms[0].ctlContactusbox_radRetail.checked);
}
function ShowRetailMethod(show)
{
	window.document.getElementById("retailQuestions").style.visibility = (show) ? "visible" : "hidden";
	window.document.getElementById("retailQuestions").style.display = (show) ? "block" : "none";
}

function switchHeight(page) {
	if(page=="home") {
		var elm = document.getElementById("rightColumn");
		var elm2 = document.getElementById("homeMain");
		var elm3 = document.getElementById("leftColumn");
		var spcImg = document.getElementById("spcImg");
		var x = elm.offsetHeight;
		var x2 = elm2.offsetHeight;
		var x3 = elm3.offsetHeight;
		var newH = (x > x2) ? x : x2;
		elm3.style.height = (newH > x3) ? (newH - 10) + "px" : x3 + "px" ;
		if(x2 < x3) {
			spcImg.height = (x3 - x2) + 5;		
		}
	} else if(page=="dectree") {
		var elm = document.getElementById("pnlContactInfo");
		var elm2 = document.getElementById("mainContent");
		var spcImg = document.getElementById("spcImg");
		var x = elm.offsetHeight;
		var x2 = elm2.offsetHeight;
		if(x < x2) {
			spcImg.height = (x2 - x) + 40;
		}
	}
}

function chk_url(isFile,pdflabel)

   {
    if(isFile.indexOf(".pdf")!=-1)
      {              
       if(isFile.indexOf("http")!=-1)
         {  
           MTCml="1";
           var x = mtcDownload_GetURL(isFile,pdflabel);
           window.open(x,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes");                 
         }
       else
         {
           y=(document.domain);
	   if(document.location.toString().indexOf("/navfin/") != -1) { y += "/navfin"; }
           MTCml="1";
           var x = mtcDownload_GetURL((y + '/' +isFile),pdflabel);
           window.open(x,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes");                 
         }

       }
    else
      {
       if(isFile.indexOf("http")!=-1)
         {
          mtcMonitorLink(isFile,pdflabel);
         }
       else
         {
          y=(document.domain);
	  if(document.location.toString().indexOf("/navfin/") != -1) { y += "/navfin"; }
          mtcMonitorLink((y + '/' +isFile),pdflabel);
         }
       }
   }