/* for tabbing*/

function st1(t,strIMG){
	document.getElementById('toggle').style.backgroundImage = "url("+strIMG+")"; 
	var toggle = document.getElementById('toggle');
var as = toggle.getElementsByTagName('a');
for(i=1;i<=as.length;i++){
			
		tr = document.getElementById('dd'+i);
		tl = document.getElementById('ll'+i);
		ta = document.getElementById('aa'+i);
	
		if(t==i){
	 			
			  tr.style["display"]="block";
			 tr.style["visibility"]="visible";
			//tl.className="cat-lnk1";	
					}
		else{
		  		
		 	  tr.style["display"]="none";
  		  tr.style["visibility"]="hidden";
		//tl.className="cat-lnk";
		}
	  }

}

var CitArray=new Array('DELHI','JAIPUR','VARANASI','AGRA','LADAKH','KOCHI','TAJ MAHAL','KHAJURAHO','HIMALAYAS','AYURVEDA','DAL LAKE','BACKWATERS','RAFTING','TREKKING','SKIING','SAFARIS','ANGLING','SNORKELLING');

/*query form validation starts*/
<!-- HIDING FROM OTHER BROWSERS
expires = new Date();
expires.setTime (expires.getTime() + 24 * 60 * 60 * 150 * 1000);
function set(){

dd = document.dataform;

if(document.dataform.S_name.value == "")
{
	alert("Please enter your Name.");
	document.dataform.S_name.focus();
	return (false);
}

if(document.dataform.S_email.value.indexOf(" ") >= 0)
{
	alert("Please enter your email-id without any white space character.");
	document.dataform.S_email.focus();
	return (false);
}
if ( (document.dataform.S_email.value.indexOf("@") == -1) || (document.dataform.S_email.value.indexOf(".") == -1) )
{
	alert("Please enter a valid email-id"); 
	document.dataform.S_email.focus();
	return (false);
}


BeforeAtRate = document.dataform.S_email.value.substring(0,document.dataform.S_email.value.indexOf("@"));
AfterAtRate = document.dataform.S_email.value.substring(document.dataform.S_email.value.indexOf("@")+1,document.dataform.S_email.value.length);

if (AfterAtRate.indexOf(".") == -1)
{
	alert("Please enter a valid email-id"); 
	document.dataform.S_email.focus();
	return (false);
}

middle = AfterAtRate.substring(0, AfterAtRate.indexOf("."))
last = AfterAtRate.substring(AfterAtRate.indexOf(".") + 1,AfterAtRate.length)

if (BeforeAtRate.length == 0 || middle.length == 0 || last.length == 0)
{
	alert("Please enter a valid email-id"); 
	document.dataform.S_email.focus();
	return (false);
}

if(document.dataform.S_phone.value == "")
{
	alert("Please enter your Phone No.");
	document.dataform.S_phone.focus();
	return (false);
}

if(document.dataform.S_country.selectedIndex == 0)
{
	alert("Please select your Country.");
	document.dataform.S_country.focus();
	return (false);
}

if(dd.Month_of_travel.selectedIndex==0)
{
	alert("Please select your month of travel");
	dd.Month_of_travel.focus();
	return false;
}

if(dd.Year_of_travel.selectedIndex==0)
{
	alert("Please select your year of travel");
	dd.Year_of_travel.focus();
	return false;
}

if(document.dataform.Duration.value == "")
{
	alert("Please select your duration of stay in India.");
	document.dataform.Duration.focus();
	return (false);
}



if(dd.Adults.selectedIndex==0)
{
	alert("Please select the no. of Adults travelling");
	dd.Adults.focus();
	return false;
}

if(dd.Children.selectedIndex==0)
{
	alert("Please select the no. of Children travelling");
	dd.Children.focus();
	return false;
}

if(document.dataform.Description.value=="")
{
	alert("Please enter your travel requirements");
	document.dataform.Description.focus();
	return false;
}

// Referrer and selfurl


if (document.referrer&&document.referrer!="")
        {
                document.dataform.referer.value = document.referrer;
        }
        document.dataform.self_url.value = document.location.href;
//
newCookie = document.dataform.S_name.value;
newCookie +="|"+document.dataform.S_email.value;
newCookie +="|";
setCookie("newImeshID",newCookie);

return true;
}
function get(){
if( (cookie = getCookie("newImeshID")) > ""){
	Values = cookie.split("|");
	if (Values.length >= 0){
		if (document.dataform.S_name.value.length == 0) document.dataform.S_name.value = Values[0];
		if (document.dataform.S_email.value.length == 0)    document.dataform.S_email.value = Values[1];
	}
}

/*if(window.location.href.indexOf("query")==-1)
{
if( (cookie = getCookie("tabcookie")) > "")
	{
//		alert(cookie);
		st2(cookie);
	}
}*/

return true;
}
function setCookie(name, value){
if (value.length > 0)
 document.cookie = name + "=" + escape(value)+ ";"+"expires=" + expires.toGMTString()+";"+"path=/;"
}
function getCookie(Name) {
          var search = Name + "="
          if (document.cookie.length > 0) { // if there are any cookies
                    offset = document.cookie.indexOf(search) 
                    if (offset != -1) { // if cookie exists 
                              offset += search.length 
                              // set index of beginning of value
                              end = document.cookie.indexOf(";", offset) 
                              // set index of end of cookie value
                              if (end == -1) end = document.cookie.length
                              return unescape(document.cookie.substring(offset, end))
                    } 
          }
return "";
}
//Getting parameter name from url starts
var is_input = document.URL.indexOf('?');
var tour_value = '';
if (is_input != -1)
{
	addr_str = document.URL.substring(is_input+1, document.URL.length);
	strarr = addr_str.split("&");
	var param_name = unescape((strarr[0].split("="))[0]);
	if(param_name == "tour")
	{
		tour_value = unescape((strarr[0].split("="))[1]);
		tour_value = tour_value.replace(/\+/g," ");
	}
}

function settab(tid)
{
tab_sel = tid
setCookie("tabcookie",tab_sel);
}
//Getting parameter name from url ends

// STOP HIDING FROM OTHER BROWSERS -->


// Photo Gallery Load script.
// With image cross fade effect for those browsers that support it.
// Script copyright (C) 2004-2006 http://www.cryer.co.uk/.
// Script is free to use provided this copyright header is included.
var currentGalleryLink = new Array();
function LoadPicture(pictureName,imageFile)
{
	if (document.all)
	{
		document.getElementById(pictureName).style.filter="blendTrans(duration=1)";
		document.getElementById(pictureName).filters.blendTrans.Apply();
	}
	document.getElementById(pictureName).src = imageFile;
	if (document.all)
	{
		document.getElementById(pictureName).filters.blendTrans.Play();
	}
	// Which link is currently selected?
	for (i=0; i < document.links.length;i++)
	{
	   	var l=document.links[i];
	   	var n=l.getAttributeNode('onclick');
		if (n)
		{
			var onclick = n.value;
	   		if ((onclick) &&
	   			(onclick.indexOf(pictureName) > 0) &&
	   			(onclick.indexOf(imageFile) > 0))
	   		{
			    currentGalleryLink[pictureName] = i;
			    break;
			}
		}
	}
}

// second Photo Gallery Load script.

function LoadGallery(pictureName1,imageFile1,pictureName2,imageFile2)
{
  document.getElementById(pictureName1).src = imageFile1;
  document.getElementById(pictureName2).src = imageFile2;
}


var is_input = document.URL.indexOf('?');
var tour_value = '';
var city_Cnt=0;
if (is_input != -1)
{
	addr_str = document.URL.substring(is_input+1, document.URL.length);
	strarr = addr_str.split("&");
	var param_name = unescape((strarr[0].split("="))[0]);
	if(param_name == "tour")
	{
		tour_value = unescape((strarr[0].split("="))[1]);
		tour_value = tour_value.replace(/\+/g," ");
	}
	for(var i=0;i<CitArray.length;i++){
		if(CitArray[i]==tour_value.toUpperCase()){
			city_Cnt=i;
		}
	}
}
function LoadCity(CName){
	city_Cnt=CName;
	if (CName==0)
	{
		st1('1','gifs/tab-bg.gif');
		LoadPicture('EmilyGallery', 'gifs/rashtrapati-bhavan.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/qutab-minar.jpg', 'EmilyGallery2', 'gifs/humayun-tomb.jpg');
	}
	else if (CName==1)
	{
		st1('2','gifs/tab-bg1.gif');
		LoadPicture('EmilyGallery', 'gifs/hawamahal-jaipur.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/amber-fort.jpg', 'EmilyGallery2', 'gifs/guard-city-palace.jpg');
	}
	
	else if (CName==2)
	{
		st1('3','gifs/tab-bg2.gif');
		LoadPicture('EmilyGallery', 'gifs/saddhu-varanasi.jpg');
		LoadGallery('EmilyGallery1', 'gifs/aarti.jpg', 'EmilyGallery2', 'gifs/holy-dip.jpg');
	}
	else if (CName==3)
	{
		st1('4','gifs/tab-bg3.gif');
		LoadPicture('EmilyGallery', 'gifs/taj-mahal-agra.jpg');
		LoadGallery('EmilyGallery1', 'gifs/agra-fort.jpg', 'EmilyGallery2', 'gifs/fatehpur-sikri-agra.jpg');
	}
	else if (CName==4)
	{
		st1('5','gifs/tab-bg4.gif');
		LoadPicture('EmilyGallery', 'gifs/ladakh-monastery.jpg');
		LoadGallery('EmilyGallery1', 'gifs/mountain-leh.jpg', 'EmilyGallery2', 'gifs/loard-buddha.jpg');
	}
	else if (CName==5)
	{
		st1('6','gifs/tab-bg5.gif'); 
		LoadPicture('EmilyGallery', 'gifs/kochi.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/cochin-beach.jpg', 'EmilyGallery2', 'gifs/kathakali-dancer.jpg');
	}
	else if (CName==6)
	{
		st1('1','gifs/tab-bg.gif');
		LoadPicture('EmilyGallery', 'gifs/tajamahal-agra.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/taj-mahal.jpg', 'EmilyGallery2', 'gifs/tajmahal.jpg');
	}
	else if (CName==7)
	{
		st1('2','gifs/tab-bg1.gif');
		LoadPicture('EmilyGallery', 'gifs/khajuraho.jpg');
		LoadGallery('EmilyGallery1', 'gifs/khajuraho-sculpture.jpg', 'EmilyGallery2', 'gifs/khajuraho-temple.jpg');
	}
	else if (CName==8)
	{
		st1('3','gifs/tab-bg2.gif'); 
		LoadPicture('EmilyGallery', 'gifs/himalaya.jpg');
		LoadGallery('EmilyGallery1', 'gifs/himalaya-peak.jpg', 'EmilyGallery2', 'gifs/snowy-peaked-himalaya.jpg');
	}
	else if (CName==9)
	{
		st1('4','gifs/tab-bg3.gif');
		LoadPicture('EmilyGallery', 'gifs/ayurveda.jpg');
		LoadGallery('EmilyGallery1', 'gifs/ayurvedic-bath.jpg', 'EmilyGallery2', 'gifs/ayurvedic-massage.jpg');
	}
	else if (CName==10)
	{
		st1('5','gifs/tab-bg4.gif');
		LoadPicture('EmilyGallery', 'gifs/dal-lake.jpg');
		LoadGallery('EmilyGallery1', 'gifs/dallake.jpg', 'EmilyGallery2', 'gifs/dallake-kashmir.jpg');
	}
	else if (CName==11)
	{
		st1('6','gifs/tab-bg5.gif');
		LoadPicture('EmilyGallery', 'gifs/backwater.jpg');
		LoadGallery('EmilyGallery1', 'gifs/backwaters.jpg', 'EmilyGallery2', 'gifs/fisherman.jpg');
	}
	else if (CName==12)
	{
		st1('1','gifs/tab-bg.gif'); 
		LoadPicture('EmilyGallery', 'gifs/rafting.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/water-rafting.jpg', 'EmilyGallery2', 'gifs/rafting-water.jpg');
	}
	else if (CName==13)
	{
		st1('2','gifs/tab-bg1.gif'); 
		LoadPicture('EmilyGallery', 'gifs/trekking.jpg');
		LoadGallery('EmilyGallery1', 'gifs/trekker.jpg', 'EmilyGallery2', 'gifs/trekkers.jpg');
	}
	else if (CName==14)
	{
		st1('3','gifs/tab-bg2.gif');
		LoadPicture('EmilyGallery', 'gifs/skiing.jpg');
		LoadGallery('EmilyGallery1', 'gifs/snow-skiing.jpg', 'EmilyGallery2', 'gifs/skier.jpg');
	}
	else if (CName==15)
	{
		st1('4','gifs/tab-bg3.gif'); 
		LoadPicture('EmilyGallery', 'gifs/jungle-safari.jpg');
		LoadGallery('EmilyGallery1', 'gifs/junglesafari.jpg', 'EmilyGallery2', 'gifs/camel-safari.jpg');
	}
	else if (CName==16)
	{
		st1('5','gifs/tab-bg4.gif');
		LoadPicture('EmilyGallery', 'gifs/angling.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/boy-angling.jpg', 'EmilyGallery2', 'gifs/man-angling.jpg');
	}
	else if (CName==17)
	{
		st1('6','gifs/tab-bg5.gif'); 
		LoadPicture('EmilyGallery', 'gifs/scuba-diving.jpg'); 
		LoadGallery('EmilyGallery1', 'gifs/scubadiving.jpg', 'EmilyGallery2', 'gifs/india-scubadiving.jpg');
	}
}


