
/*-------------------------------------------------------------------------*/
//  this function sets zero value to all room types comboes at product pages
// gets rooms ammount, sufix and prefix of combo name
//
function EmptyRoomTypeAmmount( amm, sfx, prx )
{
	var oCombo;
	var start = 0;
	try // some objects starts from 0
	{
		oCombo = document.getElementById(sfx+start+prx);
		oCombo.selectedIndex=0;
	}
	catch ( exp ) // and some objects starts from 1
	{
		amm		= amm+1;
	}
	
	for ( ii=1; ii<amm; ii++ )
	{
		oCombo = document.getElementById(sfx+ii+prx);
		oCombo.selectedIndex=0;
	}
}
/*-------------------------------------------------------------------------*/

/*-------------------------------------------------------------------------*/
//  this function places account data fro ELAL Spontany and submits the form
// ( uses in file library/search.asp, flights )
//
function goToSpontany()
{
	var oAgentIata		= document.getElementById("AgentIata");
	var oAgentCityCode	= document.getElementById("AgentCityCode");
	var oAgentMail		= document.getElementById("AgentMail");
	var ofrmAgentIata	= document.getElementById("frmAgentIata");
	
	oAgentIata.value		= '37201426';
	oAgentCityCode.value	= 'XST';
	oAgentMail.value		= 'shelly@shellytors.co.il;jacob@shellytours.co.il';
	
	ofrmAgentIata.action	= 'https://app.elal.co.il/spontany/StartAgent.aspx';
	ofrmAgentIata.submit();
}
/*-------------------------------------------------------------------------*/

<!--
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function spawnWindow(desktopURL,windowName,width,height,scroll) 
{
	window.open(desktopURL, windowName, "toolbars=no,top=250,left=350,scrollbars="+scroll+",width="+width+",height="+height );
}

function formValidation(formName,idsToValid)
{//alert(formName+" "+idsToValid)
	var fieldValue;
	var idsArray = idsToValid.split(",")
	for(var ii=0;ii<idsArray.length;ii++)
	{
		fieldValue = document.getElementById(idsArray[ii]).value;
		//alert(fieldValue)
		//return false;
		if(fieldValue=="")
		{
			alert('מלא שדה ' + eval("text"+ idsArray[ii] +".innerText"))
			return false;
		}
	}
	
}

function sendUrl()
{
	var link = "friend.asp?link=" + document.location.href;
	spawnWindow(link,'rec',250,360,'no');
}

//search results functions start:
var itemBG;
function HiThis(item)
{
	//alert(item);
	var itemTR = eval("document.all." + item);
	var itemIMG = eval("document.all." + item + "_image");
	itemBG = itemTR.style.backgroundColor;
	itemTR.style.backgroundColor = "#FF9020";
	itemIMG.src = "images/but_details_over.gif"
			
}
		
function LowThis(item)
{
	//alert(item);
	var itemTR = eval("document.all." + item);
	var itemIMG = eval("document.all." + item + "_image");
	itemTR.style.backgroundColor = itemBG;
	itemIMG.src = "images/but_details.gif"
}
function show_natour_iframe(xlink, xnewwindow)
{
	if (xlink != '' && (!xnewwindow) )
	{	
		//alert(xnewwindow);
		var table_hp_image_capsules = document.all.hp_image_capsules
		var table_hp_image_capsules_title = document.all.hp_image_capsules_title
		var table_hp_news_capsules = document.all.hp_news_capsules
		var table_hp_news_capsules_title = document.all.hp_news_capsules_title
		var natour_iframe_wrapper = document.all.natour_iframe_wrapper
		var natour_iframe = document.all.natour_iframe
	
		//_ hide image and news capsules 
		if (table_hp_image_capsules)
			table_hp_image_capsules.style.display = 'none';
		//if (table_hp_image_capsules_title)
		//	table_hp_image_capsules_title.style.display = 'none';

		if (table_hp_news_capsules)
			table_hp_news_capsules.style.display = 'none';
		
		
		
		if (table_hp_news_capsules_title)
			table_hp_news_capsules_title.style.display = 'none';
		//_ hide image and news capsules 
		
		if (natour_iframe_wrapper)
			natour_iframe_wrapper.style.display = 'block';
	
		if (natour_iframe)
		{
			natour_iframe.src = xlink;
			natour_iframe.style.width = 542;
		}
	}
	else
	{
		//spawnWindow(xlink,"menu_link",400,400,1) 
		if (screen.width == 1024)
		{
			window.open(xlink, "menu_link", "menubar=1, top=80, left=120, scrollbars=1, resizable=1, width=645, height=550");
		}
		else
		{
			window.open(xlink, "menu_link", "menubar=1, top=80, left=0, scrollbars=1, resizable=1, width=645, height=410");
		}
	}
}
function initDoc()
{
	//_ show the left menu
	// MFXiSM_L(); 
	
	//_ show the right menu
	// MFXiSM();
	
	//_ run the header image slide show
	runSlideShow();
}
function nevigate(param,pageName)
{
	//if (pageName == "Fattal Hotel Chain")
	//	document.all.fatal_pic.style.display = "block";
	//else
	//	document.all.fatal_pic.style.display = "none";
	//document.all["page_name"].innerHTML = pageName;
	
	// logout
	if(param==-1)
		document.all["iframe1"].src = 'log_out.asp';
	else
		document.all["iframe1"].src = 'login_form.asp?src='+param;	
	//alert(page_title);
}
//search results functions end:

function HideStrip()
{
	//alert("hide");
	//location.href="strip_closed.asp";
	//parent.document.all.StripDiv.style.bottom = "-56px";
	document.all.StripDiv.style.display = "none";
}

function ShowStrip()
{
	alert("show");
	//location.href="strip.asp";
	//parent.document.all.StripDiv.style.bottom = "0px";
}

function ChangeFrameset()
{
	parent.document.body.rows='*,19';
}

function ReturnFrameset()
{
	parent.document.body.rows='*,75';
}

function ShowLogin()
{
	document.all.TDfront.style.display = "none";
	document.all.TDinside.style.display = "none";
	document.all.TDlogin.style.display = "block";
	document.all.StripLeft.innerHTML = "<img SRC=images/strip_login_left.gif>";
	document.all.StripRight.innerHTML = "<img SRC=images/strip_login_right.gif>";
}

function AfterLogin()
{
	document.all.TDfront.style.display = "none";
	document.all.TDlogin.style.display = "none";
	document.all.TDinside.style.display = "block";
	document.all.StripLeft.innerHTML = "<img SRC=images/strip_front_left.gif>";
	document.all.StripRight.innerHTML = "<img SRC=images/strip_front_right.gif>";
}

function openwin (win, width, height, scroll)
{
	if (scroll == "")
		scroll = "no";
	
	window.open (win, "page", "width="+width+", height="+height+", scrollbars="+scroll);
}

function openwin2 (win, width, height, scroll)
{
	if (scroll == "")
		scroll = "no";
	
	window.open (win, "page2", "width="+width+", height="+height+", scrollbars="+scroll);
}

function calcAge(dd,mm,yy) {
	var yourage;
	thedate = new Date()
	mm2 = thedate.getMonth() + 1
	dd2 = thedate.getDate()
	yy2 = thedate.getYear()
	if (yy2 < 100) {
	yy2 = yy2 + 1900 }
	yourage = yy2 - yy
	if (mm2 < mm) {
	yourage = yourage - 1; }
	if (mm2 == mm) {
	if (dd2 < dd) {
	yourage = yourage - 1; }
	}
	agestring = yourage + " "
	return agestring
}	

//-->