// Copyright Lovett Enterprises 2002

//search rollovers
function sMi(objImg) {
	objImg.src=objImg.src.replace("go.gif","go_on.gif");
}
function sMo(objImg) {
	objImg.src=objImg.src.replace("go_on.gif","go.gif");
}

//print rollover
function pMo(objImg) {
	objImg.src='/images/pr3.gif';
}

function pMi(objImg) {
	objImg.src='/images/pr3_out.gif';
}

function pdvShow() {
	try {
		document.all.pdv1.style.visibility='visible';
		}
	catch(err) {}
}

function pdvHide() {
	try {
		document.all.pdv1.style.visibility='hidden';
		}
	catch(err) {}
}

function bfPrint(){
	if(!isPrint && IE4) {
		try {
			var blnC, strMsg
			strMsg = ""
			if (strArrLang == "fr") {
				strMsg = "vous aimez le page Web pour tre automatiquement \n rajusts pour tre imprimeur-amical ";
					}
			else if (strArrLang == "de") {
				strMsg = "Wurden Sie mgen das 4web page automatisch nachreguliert \n werden, um Drucker-freundlich zu sein ";
				 }
			else if (strArrLang == "it") {
				strMsg = "gradite il Web page per essere riadattati automaticamente \n per essere stampatore-amichevoli ";
				 }
			else if (strArrLang == "es") {
				strMsg = "usted tiene gusto del Web page para ser reajustado \n automticamente para ser impresora-amistoso";
				}
			else if (strArrLang == "pt") {
				strMsg = "voc gostaria de ter a Web page reajustada automaticamente \n para uma perfeita impresso?";
				 }
			else if (strArrLang == "zh") {
				strMsg = "ϲҳԶر \n صǴӡѺõ";
				 }
			else if (strArrLang == "ja") {
				strMsg = " Ȃ̓v^[FDIł 邽߂ɎIɍĒ \n Dweb y[W";
				 }
			//else if (strArrLang == "ko") {
			//	strMsg = "ʴ μ  ģϱ Ͽ ڵ readjusted \n Ѵ   ϰ ߴ ";			
			else {
				strMsg = "Would you like the web page to be automatically \n readjusted to be printer-friendly";
				}
			blnC = confirm(strMsg+"?") 
			if(blnC) {
				document.bgColor="white";
				document.body.style.background='';
				var da = document.all;
				da.tdL1.width=1;
				da.imgL1.width=1;
				da.tdM1.width=125;
				da.imgM1.width=125;
				da.sq1.style.visibility = 'hidden';
				da.sq2.style.visibility = 'hidden';
				}
			isPrint = true;
			//alert('Printing');
			}
		catch(err) 
			{
				//alert(err);
			}
			
		}
}
//window.onbeforeprint=bfPrint

function cc(strLang) {
	try {			var strCheckOff = "en;fr;de;pt;es;";			if (strCheckOff.indexOf(strLang+";") != -1) 
				{				if(readCookie("lang") != strLang) saveCookie("lang",strLang,365); 				}		}
	catch(err) 
		{
			//alert(err);
		}
}function readCookie(name) {
		var nameEQ=name+"=";
		var ca=document.cookie.split(';');
		for(var i=0;i<ca.length;i++) {
			var c=ca[i];
			while (c.charAt(0)==' ') c=c.substring(1,c.length);
			if (c.indexOf(nameEQ)==0) return c.substring(nameEQ.length,c.length);
		}
		return null;
	}
	
function saveCookie(name,value,days) {
		if (days) {
			var date=new Date();
			date.setTime(date.getTime()+(days*24*60*60*1000));
			var expires="; expires="+date.toGMTString();
		} 
		else expires = "";
		document.cookie = name+"="+value+expires+"; path=/";
	}
	
function sPrint() {
	var blnSM 
	blnSM = false;
	
	if (strArrLang == "fr") {
			alert("La prochaine page que vous voyez est conue pour tre une page imprimante-amicale. copie de \nSimply elle de votre browser juste comme vous n'importe quelle autre page, et you\'ll ont un paquet maniable d'information  prendre avec que vous la page de \n\nThe est conue pour imprimer sur un morceau A4 de papier d'orientation de verticale.");
			blnSM = true; }
	if (strArrLang == "de") {
		alert("Die folgende Seite, die Sie sehen, wird entworfen, um eine Drucker-freundliche Seite zu sein. \nSimply-Druck hat sie von Ihrer Datenbanksuchroutine gerade da Sie jede mgliche andere Seite wurden und you\'ll einen handlichen INFO-Satz zum Nehmen mit, das Ihnen, wird \n\nThe-Seite entworfen, um auf einem Papierstreifen A4 der Portraitlagebestimmung zu drucken. ");
		blnSM = true; }
	if (strArrLang == "it") {
		alert(" La pagina seguente che vedete  destinata per essere una pagina stampante-amichevole. stampa di \nSimply dal vostro browser appena poich qualunque altra pagina e you\'ll ha un pacchetto pratico di Info da prendere con che voi la pagina di \n\nThe  destinata per stampare su pezzo di carta A4 dell' orientamento del portrait.  ");
		blnSM = true; }
	if (strArrLang == "es") {
		alert("La paginacin siguiente que usted ve se disea para ser una paginacin impresora-cmoda. impresin de \nSimply de su browser apenas pues usted cualquier otra paginacin, y you\'ll tiene un paquete prctico del Info a tomar con que usted la paginacin de \n\nThe se disea para imprimir en un pedazo A4 de papel de la orientacin del retrato. ");
		blnSM = true; }
	if (strArrLang == "pt") {
		alert("A pgina seguinte  um atalho para impressora. \nProceda a impresso da forma habitual e voc ter um resumo das informaes sempre  mo \n\nA pgina foi configurada para impresso em papel A4 na vertical. ");
			//alert("A pgina seguinte que voc v  projetada ser uma pgina impressora-amigvel. cpia de \nSimply de seu browser apenas porque voc toda a outra pgina, e you\'ll tem um bloco acessvel do info a fazer exame com que voc a pgina de \n\nThe  projetada imprimir em uma parte A4 de papel da orientao do retrato. ");
		blnSM = true; }
	if (strArrLang == "zh") {
		alert(" 㿴ҳǴӡѺõҳ\nSimply ӡҳ, you\'ll еӦinfo ȡ \n\nThe ҳƴӡһA4 ֽȡ  ");
		blnSM = true; }
	if (strArrLang == "ja") {
		alert("̃y[W̓v^[FDIȃy[Wł 悤ɂ Ȃ݌vĂB傤ǂ Ȃ̂ǂ̃y[W, you_ 'll ɂ ȂƎׂ֗ȃCtH[ṼpbN 悤Ɂ_nSimply  Ȃ̃uEU[̂΁_n_nThe ̃y[W͏ё̃IGe[VA4 ؂ň悤ɐ݌vĂB ");
		blnSM = true; }
	if (strArrLang == "ko") {
		alert("ʰ    μ  ģ  ̱ Ͽ εȴ. ٸ ʰ  ׹ ϰ ߴ   \nSimply   װ μϽʽÿ, you\'ll  ʿ   ̴  ø ٷ̰ ְ \n\nThe  ʻ ̼  A4   ϱ Ͽ εȴ. ");
		blnSM = true; }
										
	if (blnSM == false)
		alert("The next page that you see is designed to be a printer-friendly page. \nSimply print it from your browser just as you would any other page, and you\'ll have a handy info pack to take with you. \n\nThe page is designed to print on an A4 piece of paper of portrait orientation.");
	
	var sHREF = window.location.href
	if (sHREF.indexOf("/lang/") > 0) {
		sHREF = sHREF.split("/");
		if (sHREF.length == 9) {
			sHREF = "http://" + sHREF[2] + "/" + sHREF[5] + "/" + sHREF[8];
			}
		else {
			sHREF = "http://" + sHREF[2] + "/" + sHREF[5] + "/" + sHREF[6];
			}
		}
	document.frmlang.action = sHREF;
	document.frmlang.showprint.value=1;
	document.frmlang.submit();
	//return false;
	//bubbleEvent = false;
}
function langChange(objSelect) {
	try {		//langChange(this) //onlang select input
		var sHREF = window.location.href.split("?");
		document.frmlang.action = sHREF[0];
		document.frmlang.lang.value = objSelect.value;
		document.frmlang.submit();		}
	catch(err) 
		{
			//alert(err);
		}

}

function gotoF(objLink){
	try {		document.frmSearch.action=objLink.href;
		document.frmSearch.submit();
		return false;		}
	catch(err) 
		{
			//alert(err);
		}
}

function mhi(objTD) {
	try {			objTD.style.backgroundColor = "7894a4";
			objTD.children[0].style.color = "ffffff";
			//var ci = objTD.cellIndex;
			//ci = ci+1;
			//alert(ci);
			//popUp('HM_Menu'+ci,event);		}
	catch(err) 
		{
			//alert(err);
		}

}

function mho(objTD) {
	try {			var ci = objTD.cellIndex;
			ci = ci+1;
			//popDown('HM_Menu'+ci);

			if (ci != giMenuNumber) {
				objTD.style.backgroundColor = "";
				objTD.children[0].style.color = "666666";
				}		}
	catch(err) 
		{
			//alert(err);
		}

}


function setSSin(objS) {
	try {		objS.style.backgroundColor='7894a4';
		objS.style.color='ffffff';
		//if(objS.value=='Search')objS.value='';		}
	catch(err) 
		{
			//alert(err);
		}
}

function setSSout(objS) {
	try {		objS.style.backgroundColor='';
		objS.style.color='';
		//if(!objS.value)objS.value='Search';		}
	catch(err) 
		{
			//alert(err);
		}
}

function recRef() {
	var ref = document.referrer.split("/");
	var loc = document.location.href.split("/");
	ref = "http://" + ref[2];
	loc = "http://" + loc[2];
	if ( ref != loc && blnReferrer == false && document.referrer != "" ) {  
		document.frmlang.action = window.location.href;
		document.frmlang.lang.value = document.frmLangSelMenu.selectMenu.value;
		document.frmlang.referrer.value = document.referrer;
		document.frmlang.submit();
	}
}


function funcFind(strFind) {
	if(IE4) {
			var oRange, eB, sB
			var i, ii,  oRobj, sO, s, intF, ss;
			var tStart,tDate, tDiff, intNumFinds, intFindTimeOut
			
			sB = "<span style='BACKGROUND-COLOR: #76c5de;'>";
			eB = "</span>";
			oRange = document.body.all.sdiContent;
			i = 0;
			ii=0;
			intNumFinds=999;
			intFindTimeOut=500;
			tStart   = new Date();

			for (i = 0;i < oRange.all.length ;i++)
					{
					oRobj = oRange.all[i];
					if (oRobj.innerText != "" && oRobj.tagName != "SCRIPT" && oRobj.children.length == 0 && oRobj.innerHTML != "") {
						sO = oRobj.innerHTML;
						intF=0;
						do {
							ss= sO.toUpperCase();
							intF = ss.indexOf(strFind,intF);
							if (intF != -1) {
								sO = sO.substring(0,intF) + sB + sO.substring(intF,strFind.length+intF) + eB + sO.substring(intF+strFind.length,sO.length);
								intF = intF + sB.length + eB.length;
								i++;
								ii++;
									}
							//to stop over find
							if(ii>intNumFinds) {intF=-1;i=oRange.all.length;}
							}
						while (intF != -1);
						oRobj.innerHTML = sO;
						}
					tDate = new Date();
					tDiff = tDate.getTime() - tStart.getTime();
					if (tDiff>intFindTimeOut) i=999999;					
					}
			}
			//alert(i);
			//alert(tDiff);
   }
   


var NS4 = (document.layers);    // Which browser?
var IE4 = (document.all);

var win = window;    // window to search.
var n   = 0;

function findInPage(str) {
  var txt, i, found;

  if (str == "")
    return false;

  // Find next occurance of the given string on the page, wrap around to the
  // start of the page if necessary.

  if (NS4) {

    // Look for match starting at the current point. If not found, rewind
    // back to the first match.

    if (!win.find(str))
      while(win.find(str, false, true))
        n++;
    else
      n++;

    // If not found in either direction, give message.

    if (n == 0)
      alert("Not found.");
  }

  if (IE4) {
    txt = win.document.body.createTextRange();

    // Find the nth match from the top of the page.

    for (i = 0; i <= n && (found = txt.findText(str)) != false; i++) {
      txt.moveStart("character", 1);
      txt.moveEnd("textedit");
    }

    // If found, mark it and scroll it into view.

    if (found) {
      txt.moveStart("character", -1);
      txt.findText(str);
      txt.select();
      txt.scrollIntoView();
      n++;
    }

    // Otherwise, start over at the top of the page and find first match.

    else {
      if (n > 0) {
        n = 0;
        findInPage(str);
      }

      // Not found anywhere, give message.

      //else
      //  alert("Not found.");
    }
  }

  return false;
}
 
   
  