
var lastSearchPannel;
function atOnMouseOverLight(o)
{o.style.backgroundColor = ''; o.style.cursor = 'hand';}

function atOnMouseOutLight(o)
{o.style.backgroundColor = '';}

function atOnMouseOverDark(o)
{o.style.backgroundColor=''; o.style.cursor='hand';}

function atOnMouseOutDark(o)
{o.style.backgroundColor='';}

function MyOpenWindow(sFileName,wwidth,wheight,winname,sScrollbars,iTop)
{
        // open window
                var topvalue = 0;

                if(sScrollbars=="" || sScrollbars=="yes" || sScrollbars=="1" || arguments.length<5)
                        sScrollbars="yes";
                else
                        sScrollbars = "no";
                if(winname == "")
                        winname = "defaultwindowname";
                 ww = screen.width;
         hh = screen.height;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
                 if(iTop == "" || arguments.length < 6)
                        topvalue = yy;
                 else
                        topvalue = iTop;
         options ='location=no, toolbar=no, status=no, left='+xx+',top='+topvalue+', menubar=no, height='+wheight+', width='+wwidth+', scrollbars = '+sScrollbars+'';
         file =sFileName;
         window.open(file,winname,options);
}

function MyOpenWindow3GG(sFileName,wwidth,wheight,winname,sScrollbars,iTop)
{
        // open window
                var topvalue = 0;

                if(sScrollbars=="" || sScrollbars=="yes" || sScrollbars=="1" || arguments.length<5)
                        sScrollbars="yes";
                else
                        sScrollbars = "no";
                if(winname == "")
                        winname = "defaultwindowname";
                 ww = screen.width;
         hh = screen.height;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
                 if(iTop == "" || arguments.length < 6)
                        topvalue = yy;
                 else
                        topvalue = iTop;
         options ='location=yes,resizable=yes, toolbar=yes, status=yes, left='+xx+',top='+topvalue+', menubar=yes, height='+wheight+', width='+wwidth+', scrollbars = '+sScrollbars+'';
         file =sFileName;
         window.open(file,winname,options);
}
function MyOpenWindow3(sFileName,wwidth,wheight,winname,sScrollbars,iTop)
{
        // open window
                var topvalue = 0;

         ww = screen.width;
         hh = screen.height;
         wwidth = 800;
         wheight = 604;
      
         options ='location=yes,resizable=yes, toolbar=yes, status=yes,  menubar=yes, height='+wheight+', width='+wwidth+', scrollbars = yes';
         file =sFileName;
         window.open(file,winname,options);
}


function Send(sFileName) {
        // open window
                ww = screen.width;
         hh = screen.height;
         wwidth = 300;
         wheight = 300;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         options ='location=no, toolbar=no, status=no, left='+xx+', top='+yy+', menubar=no,height='+wheight+', width='+wwidth+', scrollbars = no';
         file =sFileName;
         window.open(file,'picview2',options);

        }

function Add_To_Favorite()
{
        if (window.external)
        {
                external.AddFavorite("http://www.tzofit.co.il", "צופית - האתר המעודכן ביותר בישראל")
        }
        else
        {
                alert(".דפדפן שלך לא תומך באופציה זו");
        }
}
function Set_Homepage()
{
        if(navigator.appVersion.charAt(navigator.appVersion.indexOf("MSIE") + 5) >= 5 && navigator.platform.indexOf("Win16") == -1 && navigator.platform.indexOf("Mac") == -1){
                if (window.external)
                        homepage.style.behavior='url(#default#homepage)';
                        homepage.setHomePage("http://www.tzofit.co.il");
        }
}

function weather(sFileName) {
        // open window
         ww = screen.width;
         hh = screen.height;
         wwidth = 790;
         wheight = 504;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         options ='location=no, toolbar=no, status=no, left='+xx+', top=40, menubar=no,height='+wheight+', width='+wwidth+', scrollbars = yes';
         file =sFileName;
         window.open(file,'weather',options);
        }

function OpenWindow(sFileName,wwidth,wheight,winname,sScrollbars,iTop) {
        // open window
                var topvalue = 0;

                if(sScrollbars=="" || sScrollbars=="yes" || sScrollbars=="1" || arguments.length<5)
                        sScrollbars="yes";
                else
                        sScrollbars = "no";
                if(winname == "")
                        winname = "defaultwindowname";

                 ww = screen.width;
         hh = screen.height;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
                 if(iTop == "" || arguments.length < 6)
                        topvalue = yy;
                 else
                        topvalue = iTop;
         options ='location=no,resizable=yes, toolbar=no, status=no, left='+xx+', top='+topvalue+', menubar=no, height='+wheight+', width='+wwidth+', scrollbars = '+sScrollbars+'';
         file =sFileName;
         window.open(file,winname,options);
        }

function OpenWin(sFileName) {
        // open window
		ww = screen.width;
        hh = screen.height;
		wwidth = ww-8;
		 wheight = hh-80;
		 top_ = 0;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         options ='location=no, toolbar=no,resizable=yes,scrollbars=yes,left='+xx+', top='+yy+', height='+wheight+', width='+ wwidth;
         file =sFileName;
         window.open(file,'picview',options);		
        }
		


function OpenWinBig(sFileName,wwidth1,wheight1,winname) {
	// open window
		ww = screen.width;
         hh = screen.height;
         wwidth = wwidth1;
         wheight = wheight1;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         options ='location=no, toolbar=no, status=no, left='+xx+', top=42, menubar=no, height='+wheight+', width='+wwidth+', scrollbars = yes';
         file =sFileName;
         window.open(file,winname,options);		
}


 function OpenWinWithNav(sFileName) {
        // open window
		ww = screen.width;
        hh = screen.height;
		wwidth = ww-8;
		 wheight = hh-80;
		 top_ = 0;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         options ='location=yes, toolbar=yes,resizable=yes,scrollbars=yes,left='+xx+', top='+yy+', height='+wheight+', width='+ wwidth;
         file =sFileName;
         window.open(file,'picview',options);		
        }   
function toggleSearchTr(divId){
var myDiv=document.getElementById(divId);
if(lastSearchPannel){
var openPannel=document.getElementById(lastSearchPannel);
}
var centerSpacerDiv=document.getElementById('centerSpacer');
var centerSpacerDiv1=document.getElementById('centerSpacer1');
if(centerSpacerDiv){
	(myDiv.style.display=='none')?centerSpacerDiv.style.height='70px':centerSpacerDiv.style.height='15px';
	(myDiv.style.display=='none')?centerSpacerDiv1.style.height='70px':centerSpacerDiv1.style.height='15px';
}
if(openPannel && openPannel!=myDiv){
		//closeDiv(lastSearchPannel,100,0)
		openPannel.style.display='none';
		}
	(myDiv.style.display=='none')?myDiv.style.display='inline':myDiv.style.display='none';	
	
	lastSearchPannel=divId;
}


function check_word()
{
	var str = document.quick_search.keyword.value;
	if( str.length < 2){
		alert("אנא הכנס מילה בת יותר מ - 2 אותיות");
		document.quick_search.keyword.focus();
	}else{
		document.quick_search.submit();
	}
}
/*Israel Meteorological Service*/
function ims_weather()
{
        window.open("http://www.ims.gov.il/tachazit.htm","big","channelmode=no,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=yes,scrollbars=no,width=630,height=500,top=30,left=100'")
}
/*******************************************/	
function change(box,types)
{	
var t;
var j;	
  box.options.length = 1;		
  for (t = 0; t < types.length; t++)
	if (types[t].selected)
	{
		if(types[t].value != 0)
		for (j = 0; j < arr_subcat[types[t].value].length; j++)	
				box.options[box.options.length]=new Option(arr_subcat[types[t].value][j].text,arr_subcat[types[t].value][j].value);	
				//box.options[box.options.length] = arr_subcat[types[t].value][j];
	}
}

function hamlatzofitlink(area_id,cat_id,ts_char){
if (ts_char.indexOf('%2C')<1){
ts_char+=','+ts_char;
}
location.href='/tour/search_map.php?cat_id='+cat_id+'&area_id='+area_id+'&city_id=0&ts_char='+ts_char;
}

function showmap(mapName){
//prompt('',mapName);
mapName = mapName.replace(/^\s*|\s*$/g,"");

switch (mapName){
case 'ramat_golan.jpg':mapVal=1;break
case 'galil_ilyon.jpg':mapVal=2;break
case 'galil_maaravi.jpg':mapVal=3;break
case 'kineret.jpg':mapVal=4;break
case 'karmel.jpg':mapVal=5;break
case 'jerusalem_yhuda.jpg':mapVal=6;break
case 'bikah.jpg':mapVal=7;break
case 'telaviv_centr.jpg':mapVal=8;break
case 'negev.jpg':mapVal=9;break
case 'eylat_arava.jpg':mapVal=10;break
default:mapVal=10;
}
var m=OWin("/tour/frames_map.php?view_one=&ts_id=&area_id="+mapVal+"&cat_id=15");
//location.href="/tour/frames_map.php?view_one=&ts_id=&area_id="+mapVal+"&cat_id=15";
}

/*******************************************/
function OpenFrame(sFileName,w,h) {
        // open window
		
		ww = screen.width;
        hh = screen.height;
		wwidth = ww-8;
		 wheight = hh-80;
		 top_ = 0;
         options ='location=no, toolbar=no, status=no, left=0, top=0, menubar=no, height='+wheight+', width='+wwidth+', scrollbars = yes';
         file =sFileName;
         window.open(file,'openframe',options);				 		 
        }
	
/*****************************************
function OpenWin(sFileName,w,h) {
        // open window
		
		ww = screen.width;
         hh = screen.height;
         wwidth = w;
         wheight = h;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         alert(wheight);
         options ='location=no, toolbar=no, status=no, left='+xx+', top=42, menubar=no, height='+wheight+', width='+wwidth+', scrollbars = yes';
         file =sFileName;
         window.open(file,'picview',options);				 		 
        }	
******************************************/	
function OpenFullScreen(sFileName) {
        // open window
		ww = screen.width;
        hh = screen.height;
		wwidth = ww-8;
		 wheight = hh-80;
		 top_ = 0;
         if(wwidth > ww) {xx=0;} else {xx=Math.round((ww-wwidth)/2)-5;};
         if(wheight > hh) {yy=0;} else {yy=Math.round((hh-wheight)/2);};
         options ='location=no, toolbar=no, status=no, left=0, top=0, menubar=no, height='+wheight+', width='+wwidth+', scrollbars = no';
         file =sFileName;
         window.open(file,'picview',options);		
        }	

/*******************************************/	

function toggleTr(TrId)
{
        var myTr=document.getElementById("tr_"+TrId);
        (myTr.style.display == 'none')? myTr.style.display = 'block': myTr.style.display = 'none';
}
function toggleTr1(TrId)
{
        var myTr=document.getElementById("d_"+TrId);
        (myTr.style.display == 'block')? myTr.style.display = 'none': myTr.style.display = 'block';
}
function toggleTr2(TrId)
{
        var myTr=document.getElementById("c_"+TrId);
        (myTr.style.display == 'block')? myTr.style.display = 'none': myTr.style.display = 'block';
}

function set_submit(cat_id)
{
	document.listform.cat_id.value = cat_id;
	document.listform.submit();
}

function fnToggle() {
	if(document.all && document.getElementById('mainImg')){
		document.getElementById('mainImg').style.filter="blendTrans(duration=1)";
		document.getElementById('mainImg').filters.blendTrans(duration=5).Apply();
		document.getElementById('mainImg').filters.blendTrans.Play();
	}
}
function setImage(imgSrc,imageTitle){
	fnToggle();
	document.getElementById('mainImg').src=imgSrc;
	if(document.getElementById('ImageTextSpan')){
		document.getElementById('ImageTextSpan').innerHTML=imageTitle;
	}
}

