var sAppDomain = "http://www.ramot-ins.co.il";
var NumberOfHPphotos = 6;
var nCurrentPic="";
var bar_length = 16;
var arrPhoto = new Array();  arrPhoto[0] = new Object();  arrPhoto[0].picName = '5prati.jpg';  arrPhoto[0].title = 'ביטוח רכב';  arrPhoto[1] = new Object();  arrPhoto[1].picName = '6dira.jpg';  arrPhoto[1].title = 'ביטוח רכב';  arrPhoto[2] = new Object();  arrPhoto[2].picName = '7iski.jpg';  arrPhoto[2].title = 'ביטוח רכב';  arrPhoto[3] = new Object();  arrPhoto[3].picName = '9tasiya.jpg';  arrPhoto[3].title = 'ביטוח רכב';  arrPhoto[4] = new Object();  arrPhoto[4].picName = '12kibutz.jpg';  arrPhoto[4].title = 'ביטוח רכב';  arrPhoto[5] = new Object();  arrPhoto[5].picName = '19pic15.jpg';  arrPhoto[5].title = 'ביטוח רכב'; 
/***********************************************/
var arrInputs = new Array();
function fnCheckFormData(oFrm) {
	var field = new fieldValidate("Field1", 0, "ביטוח רכב", true);
	arrInputs[0] = field;
	var field = new fieldValidate("Field2", 0, "ביטוח רכב", true);
	arrInputs[1] = field;
	var field = new fieldValidate("Field3", 15, "ביטוח רכב", true);
	arrInputs[2] = field;
	var field = new fieldValidate("Field4", 5, "ביטוח רכב", false);
	arrInputs[3] = field;
	 return IsValidData(oFrm);
}
/***********************************************/
function fncSetPhoto(pathOfPic,titleOfpic,TdID){	
//alert(pathOfPic);
if(pathOfPic!=null && pathOfPic.length>0){
		var otd = document.getElementById("ctlContent");

		if (document.all){
			if(otd.filters && otd.filters.length>0) otd.filters[0].apply();
			otd.style.backgroundImage = "url('images/"+pathOfPic+"')";
		}else{
			otd.style.backgroundImage = "url('images/"+pathOfPic+"')";
		}
		
		//otd.innerHTML = "<img src='images/"+pathOfPic+"' width=390 border=0>";
		otd.title = titleOfpic;
		if(otd.filters && otd.filters.length>0) otd.filters[0].play();
	}
}
/***********************************************/		
function fncReplacePhoto(TdID,ii){
	eval("fncSetPhoto(arrPhoto[" + ii + "].picName,arrPhoto[" + ii + "].title," + TdID + ")");
	nCurrentPic = ii+1;
	if (nCurrentPic == NumberOfHPphotos) {nCurrentPic = 0}
	
	if (document.all){
		setTimeout("fncReplacePhoto(" + TdID + "," + nCurrentPic + ")",3000);
	}else{
		setTimeout("fncReplacePhoto(" + TdID + "," + nCurrentPic + ")",5000);
	}
}
/***********************************************/
function fnPlaceData(oXml, sTarget, nType, sName) {
	var xmlDoc = oXml.XMLDocument.documentElement;
	
	if (nType == 5) {
		for (var nFields = 0; nFields < xmlDoc.childNodes.length; nFields++) {
			var oOption = new Option();
			oOption.value = xmlDoc.childNodes[nFields].childNodes[0].text;
			oOption.text = xmlDoc.childNodes[nFields].childNodes[0].text;
			document.all[sTarget].options[document.all[sTarget].options.length] = oOption;
		}
	}
	else if (nType == 4) {
		var sHTML = "";
		for (var nFields = 0; nFields < xmlDoc.childNodes.length; nFields++) {
			if (nFields > 0)
				sHTML += " &nbsp;";
			sHTML += "<nobr><input style=\"height:15px;\" type=\"checkbox\" name=\"" + sName + "\" value=\"" + xmlDoc.childNodes[nFields].childNodes[0].text + "\" id=\"fld" + nType+""+nFields + "\"><label for=\"fld" + nType+""+nFields + "\">" + xmlDoc.childNodes[nFields].childNodes[0].text + "</label></nobr>";
		}
		document.all[sTarget].innerHTML = sHTML;
	}
	else if (nType == 3) {
		var sHTML = "";
		for (var nFields = 0; nFields < xmlDoc.childNodes.length; nFields++) {
			if (nFields > 0)
				sHTML += " &nbsp;";
			sHTML += "<nobr><input style=\"height:15px;\" type=\"radio\" name=\"" + sName + "\" value=\"" + xmlDoc.childNodes[nFields].childNodes[0].text + "\" id=\"fld" + nType+""+nFields + "\"><label for=\"fld" + nType+""+nFields + "\">" + xmlDoc.childNodes[nFields].childNodes[0].text + "</label></nobr>";
		}
		document.all[sTarget].innerHTML = sHTML;
	}
}
/***********************************************/
function expand_bar(bar_Id) {
	var bar = document.getElementById("bar_"+bar_Id);
	//alert(bar.id);
	bar.style.display = ("block" == bar.style.display ? "none" : "block");
	for (i=1;i<bar_length;i++){
		if (i!=bar_Id){
			bar = document.getElementById("bar_"+i);
				//alert(bar);
				if(bar){
					bar.style.display = 'none';
				}
			}
	}
}
/***********************************************/
function changeClass(obj,opr) {
	if (opr==1) {
		obj.style.font = "bold 12px";
		obj.style.color = "#ff9393";
	}
	else {
		obj.style.font = "bold 12px";
		obj.style.color = "#000000";
	}
}
/***********************************************/
function fnSetAction(oSelect) {
	var sValue = oSelect[oSelect.selectedIndex].value;
	if (sValue != "-1") {
		var saValue = sValue.split("||");
		
		if (saValue[0] == "1")
			window.open(saValue[1],"_blank");
		else
			window.location = saValue[1];
	}
	else {
		oSelect.selectedIndex = 0;
	}
	return;
}
/***********************************************/
function fnShowFullImg(sFile) {
	window.open("ViewImage.asp?Image="+sFile,"image","top=50,left=50,width="+(screen.availWidth-100)+",height="+(screen.availHeight-100)+",scrollbars");
}
/***********************************************/
function fnShowGallery(iCatID,iArticleID) {
	window.open("ViewGallery.asp?CategoryID="+iCatID+"&ArticleID="+iArticleID,"gallery","top=50,left=50,width="+(screen.availWidth-100)+",height="+(screen.availHeight-100)+",scrollbars=no");
}
/***********************************************/
function fnPlaceMailData(oXml, sTarget) {
	var xmlDoc = oXml.XMLDocument.documentElement;
	var sHTML = "";
	for (var nFields = 0; nFields < xmlDoc.childNodes.length; nFields++) {
		var oOption = new Option();
		oOption.value = xmlDoc.childNodes[nFields].childNodes[1].text;
		oOption.text = xmlDoc.childNodes[nFields].childNodes[0].text;
		try {
			document.getElementById(sTarget).options[document.getElementById(sTarget).options.length] = oOption;
		} catch (e) {
		}
	}
}
/***********************************************/
function dbsSetURL(sName) {
	window.location = window.location.toString().substring(0,window.location.toString().lastIndexOf("#")) + sName;
}
/***********************************************/
function dbsMail(box,server) {
	window.location = "mailto:" + box + "@" + server;
}