function menuOver(oM,oSubM){
	document.getElementById(oSubM).style.visibility="visible";
	document.getElementById(oM).className="menuover";
}

function menuOut(oM,oSubM){

	/// delay
	nMillis=50;
	date = new Date();
	var curDate = null;
	
	do { var curDate = new Date(); } 
	while(curDate-date < nMillis);


	document.getElementById(oSubM).style.visibility="hidden";
	document.getElementById(oM).className="menuout";
}

function SubjectOver(obj){
	//alert(obj);
	//document.getElementById(obj).style.font="#C80000";
}

function SubjectOut(obj){
	//document.getElementById(obj).style.visibility="hidden";
}


function pageRef(n){
	if(eval(n)==99){
		document.theForm.action="/ptrust/wc.dll?ptbus~SEARCHRET";
		document.theForm.submit();
	}else{
		window.location.href=("/ptrust/wc.dll?ptweb~redir~&PAGEID="+eval(n));
	}
}

function pageRef1(n){
	window.location.href=("/ptrust/wc.dll?ptweb~redir~&PAGEID="+n);
}

function searchtxt(){
	i=frm.SEARCH.selectedIndex;
	if (i==0){
		txtsearch.innerText="לפני שעושים עסקה כדאי לבדוק אם העסק התחייב לכללים ונתון לבקרה - עסקים מתחייבים לכללי אמון הציבור ועומדים  בבקרה  בתשלום";
		//document.getElementById('branch').style.visibility="hidden";
		document.theForm.FREETXT.value="שם  העסק";
		document.theForm.FREETXT.disabled=false;
		document.theForm.SUBSEARCH.disabled=false;
		}
	if (i==1){
		txtsearch.innerText="  טיפים, התראות, מאמרים ומידע בתחום הצרכנות - עסקים מתחייבים לכללי אמון הציבור ועומדים  בבקרה  בתשלום";
		//document.getElementById('branch').style.visibility="visible";
		document.theForm.FREETXT.value="טקסט חופשי";
		document.theForm.FREETXT.disabled=false;
		document.theForm.SUBSEARCH.disabled=false;
		}
	if (i==2){
		txtsearch.innerText="מי העסקים שהתחייבו לפעול לפי כללי אמון הציבור - עסקים מתחייבים לכללי אמון הציבור ועומדים  בבקרה  בתשלום";
		//document.getElementById('branch').style.visibility="hidden";
		document.theForm.FREETXT.value="";
		document.theForm.FREETXT.disabled=true;
		document.theForm.SUBSEARCH.disabled=true;

		}
	if (i==3){
		txtsearch.innerText="רק כחבר אמון הציבור באפשרותך לתת ציון לעסק - עסקים מתחייבים לכללי אמון הציבור ועומדים  בבקרה בתשלום";
		//document.getElementById('branch').style.visibility="hidden";
		document.theForm.FREETXT.value="";
		document.theForm.FREETXT.disabled=false;
		document.theForm.SUBSEARCH.disabled=false;
		}
	if (i==4){
		txtsearch.innerText="מי העסקים שהתחייבו לאמון הציבור ומצויים בבדיקה - עסקים מתחייבים לכללי אמון הציבור ועומדים  בבקרה  בתשלום";
		//document.getElementById('branch').style.visibility="hidden";
		document.theForm.FREETXT.value="";
		document.theForm.FREETXT.disabled=false;
		document.theForm.SUBSEARCH.disabled=false;
		}
}

function freeTxt(){
	frm.FREETXT.value="";
}


function addToFavorite(){
	window.external.AddFavorite('http://192.168.1.10/ptrust/html/home/main.htm','Public Trust - אמון הציבור');
}	


function branchList2(){
	   	}

// branch list - xml
function branchList(){
   		
		xmlHTTP = new ActiveXObject("Microsoft.XMLHTTP");
		xmlHTTP.open("GET", '/ptrust/wc.dll?ptweb~branchxml', false);
		xmlHTTP.send(null);	 

		xmlDoc=xmlHTTP.responseXML;	
		
		// like RECCOUNT()		
		var nRECNUM=xmlDoc.documentElement.childNodes.item(0).childNodes.length;
	   	
		//alert(frm.SUBSEARCH.options[frm.SUBSEARCH.selectedIndex].value)
		
		// Clear the DROP DOWN LIST
		for (j=0; j<frm.SUBSEARCH.options.length; j++){
			frm.SUBSEARCH.options[j]=null;
		}
		for (i=0; i<nRECNUM-2; i++){
			invNode=xmlDoc.documentElement.childNodes.item(0).childNodes.item(i);
			cBRANCHID=invNode.childNodes.item(1).childNodes.item(0).nodeValue;   	
			cBRANCHDESC=invNode.childNodes.item(2).childNodes.item(0).nodeValue;   	
			//frm.SUBSEARCH[i] = new Option(cBRANCHDESC, cBRANCHID)
		
			if (cBRANCHID=="0"){
				frm.SUBSEARCH[i] = new Option(cBRANCHDESC, cBRANCHID, true, true)
			}else{
				frm.SUBSEARCH[i] = new Option(cBRANCHDESC, cBRANCHID)
			}

	   	}
}

