﻿// JScript File
var resizeTimer = setTimeout(resizeHandler,100);

function resizeHandler()
{
    window.onresize = Resize;
   
}

window.onresize = resizeHandler;
window.onload = Resize;

function Resize()
{
    var topPosition = (document.body.scrollTop + 27) + 'px';
    var placeHolder1 = document.getElementById('ctl00_SideBanners1_pnlRightBanner');
    var placeHolder2 = document.getElementById('ctl00_SideBanners1_pnlLeftBanner');
    
    if (placeHolder1 == null || placeHolder2 == null)
        return;

    if(document.body.clientWidth >= 980)
    {
	    placeHolder1.style.display = 'block';
	    placeHolder2.style.display = 'block';
    }
    else
    {
	    placeHolder1.style.display = 'none';			
	    placeHolder2.style.display = 'none';		
    }	

    window.onresize = function() {;};
    clearTimeout(resizeTimer);
    resizeTimer=setTimeout(resizeHandler,1);
}

function AddFavorites()
{
    window.external.AddFavorite(location.href, document.title);
}

function Openpane(paneIndex)
{ 
    var behavior = $get("ctl00_Accordion1").AccordionBehavior;
    behavior.set_SelectedIndex(paneIndex); 
}

function GotoLink(linkURL)
{
    var width = document.body.clientWidth;
    var height = document.body.clientHeight;
    
    var win = window.open(linkURL, "RowBanner", "width=" + width + ", height=" + height + ",status=1,toolbar=1,location=1,menubar=1,directories=1,resizable=1,scrollbars=1");
    //window.location.href = linkURL;
}

function getPrint(id)
{		
    var page = "Coupon.aspx";
    if (id != 0)
        page = "Coupon.aspx?id=" + id;
	
	var win = window.open(page, "win", "width=400,height=400,menubar=0,toolbar=0,location=0,status=1,scrollbars=0,directories=0,resizable=2");                  				
}	

function searchCustomerByRegion(regionID)
{    
	var myRestTypectrl = document.getElementById('ddlRestType');
	var restTypeID = parseInt(myRestTypectrl.value);
	var page = "Zimmers.aspx";
	
	switch (restTypeID)
	{
	    case 1:
	        page = "Zimmers.aspx";
	        break;
	    case 2:
	        page = "Hotels.aspx";
	        break;
	    case 3:
	        page = "Attractions.aspx";
	        break;
	    case 4:
	        page = "Spa.aspx";
	        break;
	    case 5:
	        page = "Restaurants.aspx";
	        break;
	    case 6:
	        page = "Tracks.aspx";
	        break;	
	    case 7:
	        page = "Boutique.aspx";
	        break;
	    case 8:
	        page = "Caravanserai.aspx";
	        break;	
	    case 9:
	        page = "Hostels.aspx";
	        break;	  
	}
	
	document.location.href = page + "?r=" + regionID + "&map=1";
}

function openVideoWindow(customerID) 
{
	var openWin1 = window.open("./Video.aspx?customerID="+ customerID +"&lang=HE", 'openCustVideo', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,top=100,left=100,width=340 height=548');
	openWin1.focus();
}



