//-----------------------------------------------------------------------------------------------------//
//    Page Name 		: mainPage.js		
//    Page Description	: java script file for main home page
//    Creation Date		: 31 Mar 2005
//    Creator			: Tavinder Singh
//    Modification Date	:	
//    Modifier			:		 
//-----------------------------------------------------------------------------------------------------//

var c_blank = "<img src='images/white_dot.jpg' width='100%' height='1'>";
var v_flag=0
var _serverPath;
function change_flights()
{
	if (document.all('op_flights').style.display=='block')
	{
		document.all('op_flights').style.display='none';
	}
	else
	{
		document.all('op_flights').style.display='block';
	}
	
	document.all('op_accom').style.display='none';
	document.all('op_pack').style.display='none';
	document.all('op_act').style.display='none';
	document.all('op_site').style.display='none';
	document.all('op_car').style.display='none';
	document.all('op_cruise').style.display='none';
	document.all('op_services').style.display='none';
	
	document.all('hidSlideActive').value='change_flights';	
	document.all('hidControlName').value='';
}

function change_accom()
{
	if (document.all('op_accom').style.display=='block')
	{
		document.all('op_accom').style.display='none';
	}
	else
	{
		document.all('op_accom').style.display='block';
	}
		
	document.all('op_flights').style.display='none';
	document.all('op_pack').style.display='none';
	document.all('op_act').style.display='none';
	document.all('op_site').style.display='none';
	document.all('op_car').style.display='none';
	document.all('op_cruise').style.display='none';
	document.all('op_services').style.display='none';
	
	document.all('hidSlideActive').value='change_accom';
	document.all('hidControlName').value='~/userControls/bookings/accomodation/ucSearch';
		
	//doPostBack();
}

function change_pack()
{	
	
	if (document.all('op_pack').style.display=='block')
	{
		document.all('op_pack').style.display='none';
	}
	else
	{
		document.all('op_pack').style.display='block';
	}
		
	document.all('op_flights').style.display='none';
	document.all('op_accom').style.display='none';	
	document.all('op_act').style.display='none';
	document.all('op_site').style.display='none';
	document.all('op_car').style.display='none';
	document.all('op_cruise').style.display='none';
	document.all('op_services').style.display='none';

	document.all('hidSlideActive').value='change_pack';		
	document.all('hidControlName').value='';
	
}
function change_act()
{
	if (document.all('op_act').style.display=='block')
	{
		document.all('op_act').style.display='none';
	}
	else
	{
		document.all('op_act').style.display='block';
	}
		
	document.all('op_flights').style.display='none';
	document.all('op_accom').style.display='none';
	document.all('op_pack').style.display='none';	
	document.all('op_site').style.display='none';
	document.all('op_car').style.display='none';
	document.all('op_cruise').style.display='none';
	document.all('op_services').style.display='none';

	document.all('hidSlideActive').value='change_act';		
	document.all('hidControlName').value='';					
}
function change_site()
{
	if (document.all('op_site').style.display=='block')
	{
		document.all('op_site').style.display='none';
	}
	else
	{
		document.all('op_site').style.display='block';
	}
		
	document.all('op_flights').style.display='none';
	document.all('op_accom').style.display='none';
	document.all('op_pack').style.display='none';
	document.all('op_act').style.display='none';	
	document.all('op_car').style.display='none';
	document.all('op_cruise').style.display='none';
	document.all('op_services').style.display='none';

	document.all('hidSlideActive').value='change_site';	
	document.all('hidControlName').value='';								
}
function change_car()
{
	if (document.all('op_car').style.display=='block')
	{
		document.all('op_car').style.display='none';
	}
	else
	{
		document.all('op_car').style.display='block';
	}
	
	document.all('op_flights').style.display='none';
	document.all('op_accom').style.display='none';
	document.all('op_pack').style.display='none';
	document.all('op_act').style.display='none';
	document.all('op_site').style.display='none';	
	document.all('op_cruise').style.display='none';
	document.all('op_services').style.display='none';

	document.all('hidSlideActive').value='change_car';	
	document.all('hidControlName').value='';					
}
function change_cruise()
{
	if (document.all('op_cruise').style.display=='block')
	{
		document.all('op_cruise').style.display='none';
	}
	else
	{
		document.all('op_cruise').style.display='block';
	}
	
	document.all('op_flights').style.display='none';
	document.all('op_accom').style.display='none';
	document.all('op_pack').style.display='none';
	document.all('op_act').style.display='none';
	document.all('op_site').style.display='none';
	document.all('op_car').style.display='none';	
	document.all('op_services').style.display='none';

	document.all('hidSlideActive').value='change_cruise';
	document.all('hidControlName').value='';							
}
function change_services()
{
	if (document.all('op_services').style.display=='block')
	{
		document.all('op_services').style.display='none';
	}
	else
	{
		document.all('op_services').style.display='block';
	}
	
	document.all('op_flights').style.display='none';
	document.all('op_accom').style.display='none';
	document.all('op_pack').style.display='none';
	document.all('op_act').style.display='none';
	document.all('op_site').style.display='none';
	document.all('op_car').style.display='none';
	document.all('op_cruise').style.display='none';	

	document.all('hidSlideActive').value='change_services';	
	document.all('hidControlName').value='';				
}


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 doPostBack()
{
	//alert(location.href);
	//location.href='default.aspx';
	//alert(location.href);
	var theForm = document.forms['frmDefault'];	
	theForm.action
	theForm.submit();
}

function setSelectedMenuItem(intItemId)
{
	if (intItemId==0)
	{		
		document.all('hidPrevPropertyID').value=document.all('hidMenuItemId').value
		document.all('hidMenuItemId').value='';	
	}
	else
	{		
		document.all('hidPrevPropertyID').value=document.all('hidMenuItemId').value
		document.all('hidMenuItemId').value=intItemId;	
		//alert(document.all('hidPrevPropertyID').value)
		//alert(document.all('hidMenuItemId').value)			
	}
	
	setVeiwState();
}

function setVeiwState()
{
	document.all('hidPrevPropertyID').value=document.all('hidMenuItemId').value
	document.all('hidEmptySesControlNameFlag').value="true"
	//document.all('hidMenuItemId').value=intItemId;	
	//alert(document.all('hidPrevPropertyID').value)
	//alert(document.all('hidMenuItemId').value)	
	
}

function activeSlide()
{
	var strActiveSlide
	strActiveSlide=document.all('hidSlideActive').value
	//alert(strActiveSlide);
	if (strActiveSlide!="")
	{
		if (strActiveSlide=='change_accom')
		{
			change_accom();
		}
		else if (strActiveSlide=='change_pack')
		{
			change_pack();
		}
		else if (strActiveSlide=='change_act')
		{
			change_act();
		}
		else if (strActiveSlide=='change_site')
		{
			change_site();
		}
		else if (strActiveSlide=='change_car')
		{
			change_car();
		}
		else if (strActiveSlide=='change_cruise')
		{
			change_cruise();
		}
		else if (strActiveSlide=='change_services')
		{
			change_services();
		}
		else if (strActiveSlide=='change_flights')
		{
			change_flights();
		}
	}
	
	//onBodyLoad();	
}

function onBodyLoad()
{	
	if (document.all('ucRigthPane_UcLogin_txtUserName'))
	{
		document.all('ucRigthPane_UcLogin_txtUserName').focus();
	}	
	
	//alert(document.all('hidMoreInfoActive').value)	
	
	if(document.all('divMoreInfo').value=='block')
	{
		document.all('divMoreInfo').style.display='none';
	}
	else
	{
		document.all('divMoreInfo').style.display='block';
	}
}

function switchMoreInfo()
{
	//alert(document.all('divMoreInfo').style.display)
	if (document.all('divMoreInfo').style.display=='block')
	{
		document.all('divMoreInfo').style.display='none';
		//document.all('hidMoreInfoActive').value='none';
	}
	else
	{
		document.all('divMoreInfo').style.display='block';
		//document.all('hidMoreInfoActive').value='block';
	}
	//alert(document.all('hidMoreInfoActive').value)
}

function setSearchForCity()
{
	document.all('hidSeacrhFor').value='city';	
}

function setSearchForProperty()
{
	document.all('hidSeacrhFor').value='property';
}


function getpage(url,txtPostCode)
	{
		aa=	txtPostCode.value;
		
		if(aa=='')
		{
		alert("Please Enter Correct Code");
		return false
		}
		else{
		window.open(url+"code="+aa,'abc','menubar=no,scrollbars=yes,left=10,top=10,width=880,height=400,resizable=Yes');
		}
	}	
	
function callShowAll()
{
	document.all('ucLeftPane_UcShoppingCart1_divShowAll').style.display='block';
	document.all('ucLeftPane_UcShoppingCart1_divShowLeast').style.display='none';
}
function callHideAll()
{
	document.all('ucLeftPane_UcShoppingCart1_divShowAll').style.display='none';
	document.all('ucLeftPane_UcShoppingCart1_divShowLeast').style.display='block';
}

//----------added by irabanta on 11-jan-2006, to open brouchures from header banner
function setServerPath(strPath)
{
	_serverPath=strPath;
}

function openBroucher(iSlNo)
{
	var strPath;
	switch(iSlNo)
	{
		case 1: //Austria
			strPath= _serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 2: //Britain
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 3: //Egypt
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 4: //Greece
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 5: //Italy
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 6: //Latin
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 7: //spain
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
		case 8: //car rental
			strPath=_serverPath+"/pdfspecials/Rio%20Carnival%20AUS_NZ.pdf";
			break;
	}
	window.open(strPath,'broucher',"scrollbars=yes,status=no,resizable=yes,toolbar=no,height=600,width=800");
}
//--------------xxxxxxxxxxxxxxxx--------------
function swapHeaderImages(strImage,strImgPath)
{
	document.all(strImage).src=strImgPath;
}

//=============very important and you should not modify at all
//check to see that one's browser supports javascript or not
function checkAndTestForJsScript(paraHidIsJsActive, paraHidCookiesActive)
{
	document.all(paraHidIsJsActive).value='Y';
	checkAndTestForCookies(paraHidCookiesActive);
}

function checkAndTestForCookies(paraHidCookiesActive1)
{
	var testcookie='jscookietest=valid';
	document.cookie=testcookie;
	if (document.cookie.indexOf(testcookie)==-1) 
		document.all(paraHidCookiesActive1).value='N';	
	else
		document.all(paraHidCookiesActive1).value='Y';	
}
//============================================================
