//Motion Pack
var timerlen = 5;
var slideAniLen = 250;

var timerID = new Array();
var startTime = new Array();
var obj = new Array();
var endHeight = new Array();
var moving = new Array();
var dir = new Array();

function slidedown(objname){
        if(moving[objname])
                return;

        if(document.getElementById(objname).style.display != "none")
                return; // cannot slide down something that is already visible

        moving[objname] = true;
        dir[objname] = "down";
        startslide(objname);
}
function slideup(objname){
        if(moving[objname])
                return;

        if(document.getElementById(objname).style.display == "none")
                return; // cannot slide up something that is already hidden

        moving[objname] = true;
        dir[objname] = "up";
        startslide(objname);
}
function startslide(objname){
        obj[objname] = document.getElementById(objname);

        endHeight[objname] = parseInt(obj[objname].style.height);
        startTime[objname] = (new Date()).getTime();

        if(dir[objname] == "down"){
                obj[objname].style.height = "1px";
        }

        obj[objname].style.display = "block";

        timerID[objname] = setInterval('slidetick(\'' + objname + '\');',timerlen);
}
function slidetick(objname){
        var elapsed = (new Date()).getTime() - startTime[objname];

        if (elapsed > slideAniLen)
                endSlide(objname)
        else {
                var d =Math.round(elapsed / slideAniLen * endHeight[objname]);
                if(dir[objname] == "up")
                        d = endHeight[objname] - d;

                obj[objname].style.height = d + "px";
        }

        return;
}
function endSlide(objname){
        clearInterval(timerID[objname]);

        if(dir[objname] == "up")
                obj[objname].style.display = "none";

        obj[objname].style.height = endHeight[objname] + "px";

        delete(moving[objname]);
        delete(timerID[objname]);
        delete(startTime[objname]);
        delete(endHeight[objname]);
        delete(obj[objname]);
        delete(dir[objname]);

        return;
}
function toggleSlide(objname){
	if(document.getElementById(objname).style.display == "none"){
		// div is hidden, so let's slide down
		slidedown(objname);
	}else{
		// div is not hidden, so slide up
		slideup(objname);
	}
}

//tinybox js
var TINY={}; function T$(i){return document.getElementById(i)} TINY.box=function(){ var p,m,b,fn,ic,iu,iw,ih,ia,f=0; return{ show:function(c,u,w,h,a,t){ if(!f){p=document.createElement('div'); p.id='tinybox'; m=document.createElement('div'); m.id='tinymask'; b=document.createElement('div'); b.id='tinycontent'; document.body.appendChild(m); document.body.appendChild(p); p.appendChild(b); f=1 } if(!a&&!u){ p.style.width=w?w+'px':'auto'; p.style.height=h?h+'px':'auto'; p.style.backgroundImage='none'; b.innerHTML=c }else{ b.style.display='none'; p.style.width=p.style.height='100px' } this.mask(); ic=c; iu=u; iw=w; ih=h; ia=a; this.alpha(m,1,80,3); }, fill:function(c,u,w,h,a){ if(u){ p.style.backgroundImage=''; var x=window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject('Microsoft.XMLHTTP'); x.onreadystatechange=function(){ if(x.readyState==4&&x.status==200){TINY.box.psh(x.responseText,w,h,a)} }; x.open('GET',c,1); x.send(null) }else{ this.psh(c,w,h,a) } }, psh:function(c,w,h,a){ if(a){ if(!w||!h){ var x=p.style.width, y=p.style.height; b.innerHTML=c; p.style.width=w?w+'px':''; p.style.height=h?h+'px':''; b.style.display=''; w=parseInt(b.offsetWidth); h=parseInt(b.offsetHeight); b.style.display='none'; p.style.width=x; p.style.height=y; }else{ b.innerHTML=c } this.size(p,w,h,4) }else{ p.style.backgroundImage='none' } }, hide:function(){ TINY.box.alpha(p,-1,0,3) }, resize:function(){ TINY.box.pos(); TINY.box.mask() }, mask:function(){ m.style.height=TINY.page.theight()+'px'; m.style.width=''; m.style.width=TINY.page.twidth()+'px' }, pos:function(){ var t=(TINY.page.height()/2)-(p.offsetHeight/2); t=t<10?10:t; p.style.top=(t+TINY.page.top())+'px'; p.style.left=(TINY.page.width()/2)-(p.offsetWidth/2)+'px' }, alpha:function(e,d,a,s){ clearInterval(e.ai); if(d==1){ e.style.opacity=0; e.style.filter='alpha(opacity=0)'; e.style.display='block'; this.pos() } e.ai=setInterval(function(){TINY.box.twalpha(e,a,d,s)},20) }, twalpha:function(e,a,d,s){ var o=Math.round(e.style.opacity*100); if(o==a){ clearInterval(e.ai); if(d==-1){ e.style.display='none'; e==p?TINY.box.alpha(m,-1,0,2):b.innerHTML=p.style.backgroundImage='' }else{ e==m?this.alpha(p,1,100,5):TINY.box.fill(ic,iu,iw,ih,ia) } }else{ var n=o+Math.ceil(Math.abs(a-o)/s)*d; e.style.opacity=n/100; e.style.filter='alpha(opacity='+n+')' } }, size:function(e,w,h,s){ e=typeof e=='object'?e:T$(e); clearInterval(e.si); var ow=e.offsetWidth, oh=e.offsetHeight, wo=ow-parseInt(e.style.width), ho=oh-parseInt(e.style.height); var wd=ow-wo>w?-1:1, hd=(oh-ho>h)?-1:1; e.si=setInterval(function(){TINY.box.twsize(e,w,wo,wd,h,ho,hd,s)},20) }, twsize:function(e,w,wo,wd,h,ho,hd,s){ var ow=e.offsetWidth-wo, oh=e.offsetHeight-ho; if(ow==w&&oh==h){ clearInterval(e.si); p.style.backgroundImage='none'; b.style.display='block' }else{ if(ow!=w){e.style.width=ow+(Math.ceil(Math.abs(w-ow)/s)*wd)+'px'} if(oh!=h){e.style.height=oh+(Math.ceil(Math.abs(h-oh)/s)*hd)+'px'} this.pos() } } } }(); TINY.page=function(){ return{ top:function(){return document.body.scrollTop||document.documentElement.scrollTop}, width:function(){return self.innerWidth||document.documentElement.clientWidth}, height:function(){return self.innerHeight||document.documentElement.clientHeight}, theight:function(){ var d=document, b=d.body, e=d.documentElement; return Math.max(Math.max(b.scrollHeight,e.scrollHeight),Math.max(b.clientHeight,e.clientHeight)) }, twidth:function(){ var d=document, b=d.body, e=d.documentElement; return Math.max(Math.max(b.scrollWidth,e.scrollWidth),Math.max(b.clientWidth,e.clientWidth)) } } }();

//MyBox js
var http_request = false; var ajaxdata_div_id = 'ajaxdata'; function createMyBox(url,w,h) { var bg_img_h = Math.max(Math.max(document.body.scrollHeight,document.documentElement.scrollHeight),Math.max(document.body.clientHeight,document.documentElement.clientHeight)); var bg_img_w = Math.max(Math.max(document.body.scrollWidth,document.documentElement.scrollWidth),Math.max(document.body.clientWidth,document.documentElement.clientWidth)); bg_img = document.getElementById('bgimg'); bg_img.height = bg_img_h; bg_img.width = bg_img_w; bg_img.style.display = 'block'; bg_img.style.position = 'absolute'; bg_img.style.zIndex = '90'; p=document.createElement('div'); p.id='mybox'; b=document.createElement('div'); b.id='mycontent'; document.body.appendChild(p); p.appendChild(b); p.style.position = 'absolute'; p.style.top = '0'; p.style.left = '40%'; p.style.zIndex = '90'; p.style.width = '100%'; p.style.width=w?w+'px':'auto'; p.style.height=h?h+'px':'auto'; b.style.width=w?w+'px':'auto'; b.style.height=h?h-20+'px':'auto'; p.style.border="solid red 3px"; callajax(url,'mycontent'); p.innerHTML+='<a href="javascript:void(0);" ONCLICK="javascript:delMyBox();" style="float:right;">X</a>'; } function delMyBox() { alert('Rohit'); document.getElementById('mycontent').style.display='none'; document.getElementById('mycontent').removeAttribute('id'); document.getElementById('mybox').style.display='none'; document.getElementById('mybox').removeAttribute('id'); document.getElementById('bgimg').style.display='none'; alert('Rohit1'); } function callajax(url,id) { http_request = false; ajaxdata_div_id = id; document.getElementById(id).innerHTML = '<DIV STYLE="height:200px;" ALIGN="CENTER">Please wait...</DIV>'; if (window.XMLHttpRequest) { http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) { http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { } } } http_request.onreadystatechange = alertContents; http_request.open('GET', url, true); http_request.send(null); } function alertContents() { if (http_request.readyState == 4) { if (http_request.status == 200) { document.getElementById(ajaxdata_div_id).innerHTML = http_request.responseText; } else { alert('There was a problem with the request.'); } } }


function getf(Form){if(Form.email.value==''){Form.email.value='Your e-mail here';Form.email.className="i1";}}
function getblank(Form){if(Form.email.value=='Your e-mail here'){Form.email.value='';Form.email.className="i3";}}
function getf1(Form){if(Form.nl_name.value==''){Form.nl_name.value='Your name here';Form.nl_name.className="i1";}}
function getblank1(Form){if(Form.nl_name.value=='Your name here'){Form.nl_name.value='';Form.nl_name.className="i3";}}

function validateit(theForm){
if (theForm.nl_name.value=='Your name here')
{alert("Please fill the name");theForm.nl_name.focus();return (false);}
if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.email.value)))
{alert("Kindly enter a valid E-mailID!\nEx:abc@yahoo.com\n      xyz@gmail.com");theForm.email.focus();return (false);}}

function openchild_nl(thisurl){
browserName = navigator.appName;browserVer = parseInt(navigator.appVersion);
condition = !(( (browserName.indexOf("Explorer") >=0 ) && (browserVer < 4) ) ||  ((browserName.indexOf("Netscape") >=0 ) && (browserVer < 2) ) ) ;
if (condition == true)CanAnimate = true;
else CanAnimate = false;
var email_val = document.theForm.email.value;var from_site_val = document.theForm.from_site.value;var is_window_val = document.theForm.is_window.value;var org_referer = document.theForm.org_referer.value;var is_im = document.theForm.is_im.value;var nl_name = document.theForm.nl_name.value;
var nl_grp_id = document.theForm.nl_grp_id.value;
var thisurl_string = thisurl + "?email=" + email_val + "&from_site=" + from_site_val + "&is_window=" + is_window_val + "&org_referer=" + org_referer + "&is_im=" + is_im + "&nl_name=" + nl_name + "&nl_grp_id=" + nl_grp_id;
if ( CanAnimate ){msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=550,height=340,top=0,left=0');
msgWindow.focus();msgWindow.location.href = thisurl_string;}else {msgWindow=window.open( thisurl_string,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=550,height=340,top=0,left=0');}}

// Hotel Booking JS Starts
function addzero( value )
{
while( value.length<2 ) value = String("0") + value;
return value;
}

function bkdates()
{
 var monthArray=new Array("January","February","March","April","May","June","July","August","September","October","November","December");
var today = new Date();
var month= today.getMonth();
var year = today.getFullYear()%100;
var fullYear=today.getFullYear();
year=new String(year);
year=addzero(year);
var countMonth=month;
for(var i=0;i<12;i++,countMonth++){
if(countMonth%12==0 && i>0){
countMonth=0;
year++;
year=new String(year);
year=addzero(year);
fullYear++;
}
document.writeln("<option value=\""+fullYear+"-"+(countMonth+1)+"\">"+monthArray[countMonth]+" '"+year);
}
}

function bkhotel(){
var currentDate = new Date(); var currentYear = 1900 + currentDate.getYear();
var dailyMS = 24*60*60*1000;
var arrivalDate = new Date(currentDate.getTime());
var departureDate = new Date(currentDate.getTime() + 1*dailyMS);
var arrivalYear = 1900+arrivalDate.getYear(); 
var arrivalMonth = 1+arrivalDate.getMonth(); var arrivalDay = arrivalDate.getDate();
var departureYear = 1900+departureDate.getYear(); 
var departureMonth = 1+departureDate.getMonth(); var departureDay = departureDate.getDate();
var a=document.b_frm;
if ((a.checkin_monthday.selectedIndex == 0) && (a.checkout_monthday.selectedIndex == 0)){
    a.checkin_monthday.options[arrivalDay].selected = true;
    a.checkout_monthday.options[departureDay].selected = true;
}

var frm = document.getElementById('b_frm');
var my = frm['b_checkin_month'].value.split("-");
var ci = new Date (my[0], my[1]-1, frm['b_checkin_day'].value, 12, 0, 0, 0);

my = frm['b_checkout_month'].value.split("-");
var co = new Date (my[0], my[1]-1, frm['b_checkout_day'].value, 12, 0, 0, 0);
if (ci >= co){
co.setTime(ci.getTime() + 1000 * 60 * 60 * 24);
frm['b_checkout_day'].value =  co.getDate();
var com = co.getMonth()+1;
frm['b_checkout_month'].value = co.getFullYear() + "-" + com;
}
}

function getDropDown()
{
	for(var i=0;i<=31;i++)
	{
		document.writeln("<option value=\""+i+"\">"+i);
	}
}
function showHiddenFields(cityname,countryflname,cityflname,grpflname,eventflname,countryname,grpname,eventname)
{
	document.writeln("<input name=\"error_url\" value=\"http://www.booking.com/index.en.html?aid=325394&amp;label=&amp;\" type=\"hidden\"><input name=\"si\" value=\"ci\" type=\"hidden\"><input name=\"ssai\" value=\"1\" type=\"hidden\"><input name=\"ssre\" value=\"1\" type=\"hidden\"><input id=\"availcheck\" name=\"do_availability_check\" value=\"on\" type=\"hidden\"><input name=\"aid\" value=\"325394\" type=\"hidden\"><input name=\"lang\" value=\"en\" type=\"hidden\"><input name=\"ifl\" value=\"1\" type=\"hidden\"><input name=\"label\" value=\"\" type=\"hidden\"><input name=\"ss\" value=\""+cityname+"\" type=\"hidden\"><INPUT TYPE=\"HIDDEN\" NAME=\"country_flname\" VALUE=\""+countryflname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"city_flname\" VALUE=\""+cityflname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"grp_flname\" VALUE=\""+grpflname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"event_flname\" VALUE=\""+eventflname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"country_name\" VALUE=\""+countryname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"city_name\" VALUE=\""+cityname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"grp_name\" VALUE=\""+grpname+"\"><INPUT TYPE=\"HIDDEN\" NAME=\"event_name\" VALUE=\""+eventname+"\">");
}
// Hotel Booking JS Ends

function settext12(Form)
{
if(Form.Y_comments.value==''){
Form.Y_comments.value='.';
Form.Y_comments.className="inp1";}
}
function descript12(Form)
{
if(Form.Y_comments.value=='.')
{Form.Y_comments.value='';
Form.Y_comments.className="inp2";}
}
function checkComment()
{
	if (document.commentform.Y_comments.value == ".")
	{
		alert ("Please fill Your Comments");
		document.commentform.Y_comments.focus();
		return (false);
	}

	if (document.commentform.Y_name.value == "")
	{
		alert ("Please fill Your Name");
		document.commentform.Y_name.focus();
		return (false);
	}
	
	if(document.commentform.Y_email.value == "")
	{
		alert("Please fill Your Email id");
		document.commentform.Y_email.focus();
		return (false);
	}
	if(! (document.commentform.Y_email.value == ""))
	{
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(document.commentform.Y_email.value)))
		{
			alert('Kindly enter a valid E-mailID!\nEx:abc@yahoo.com\n      xyz@gmail.com'); 
			document.commentform.Y_email.focus();
			return (false);
		}
	}
	if(document.commentform.captcha_text.value == "")
	{
		alert("Please fill the security code");
		document.commentform.captcha_text.focus();
		return (false);
	}
	document.commentform.submit();
}
function load_external_script(url,id)
{
	var external_script = document.getElementById(id);
	external_script.src = url;
}
function update(eventid, url)
{
	var xmlHttpReq;
	try
	{
		xmlHttpReq=new XMLHttpRequest();
	}
	catch (e)
	{
		try
		{
			xmlHttpReq=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				xmlHttpReq=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert("Your browser does not support AJAX!");return false;
			}
		}
	}
	if(xmlHttpReq)
	{
		if (xmlHttpReq.overrideMimeType)
		{
			xmlHttpReq.overrideMimeType('text/xml');
		}
		var randomnumber = Math.floor(Math.random()*9999);
		var qstr = 'eventid=' + escape(eventid) + '&action=' + escape("tf_query_page_hit_count") + '&random=' + escape("randomnumber");
		xmlHttpReq.open("GET",url + '?' + qstr,true);
		xmlHttpReq.send(null);
	}
	else
	{
		alert('Cannot create XMLHTTP instance');
		return false;
	}
}

var d = new Date();
var epoch_time =(d.getTime()-d.getMilliseconds())/1000;
var randomnumber=Math.floor(Math.random()*9999);
var randomnumber1=Math.floor(Math.random()*9999);
var ran_num=randomnumber+"."+epoch_time+"."+randomnumber1;
var url="/cgi/get_captcha.cgi?cref="+ran_num+"&style=2";
function setCaptchaRef()
{
	document.commentform.captcha_ref.value = ran_num;
}


//GOOGLE ADS TEST
function google_ad_request_done(google_ads) {
//This function is required and is used to display the ads that are returned from the JavaScript request. You should modify the document.write commands so that the HTML they write out fits with your desired ad layout.
var s = '';
var i;
//Verify that there are actually ads to display.
if (google_ads.length == 0) {
return;
}
//If an image or flash ad is returned, display that ad. Otherwise, build a string containing all of the ads and then use a document.write() command to print that string.
	if (google_ads[0].type == "text") {
		if (google_ads.length == 1) {
//Partners should adjust text sizes so ads occupy the majority of ad space.
		s += '<DIV style="background-color:#ffffff;padding:5px;"><DIV><a href=\"' +
		google_info.feedback_url + '\" style="font-family:arial; font-size:11px;color:#949494;text-decoration:none; ">Ads by Google</a></DIV><a style="font-family:arial;font-size:18px; color:#1e3589; font-weight:bold;margin-top:3px;" href="' +
		google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true">' +
		google_ads[0].line1 + '</a> <br><span style="font-family:arial; font-size:14px; color:#158f01;">' +
		google_ads[0].line2 + '&nbsp;' +
		google_ads[0].line3 + '<br></span> <span><a style="font-family:arial;font-size:12px; font-weight:bold;color:#333333;" href="' +
		google_ads[0].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
		google_ads[0].visible_url + '\';return true">' +
		google_ads[0].visible_url + '</span></a><br></DIV>';
		} else if (google_ads.length > 1) {
//For text ads, append each ad to the string.
			s += '<DIV style="background-color:#ffffff;padding:5px;'
			if(google_ads.length <= 3)
			{
				s += 'line-height:16px;">';
			}
			else
			{
				s += 'line-height:15px;">';
			}
			for(i = 0; i < google_ads.length; ++i) {
			if(i>0)
			{
				s += '<br>';
			}
			s += '<a style="font-family:arial;';
			if(google_ads.length <= 3)
			{
				s += 'font-size:15px;';
			}
			else
			{
				s += 'font-size:13px;';
			}
			s += ' color:#1072bd; font-weight:bold;margin-top:3px;" href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].line1 + '</a><br><span style="font-family:arial; font-size:12px; color:#333333;">' +
			google_ads[i].line2 + ' ' +
			google_ads[i].line3 + ' : ';
			if(google_ads.length <= 3)
			{
				s += '</span> <span><a style="font-family:arial;font-size:11px;';
			}
			else
			{
				s += '<BR></span> <span><a style="font-family:arial;font-size:10px;';
			}
			s += 'color:#158f01;" href="' +
			google_ads[i].url + '" onmouseout="window.status=\'\'" onmouseover="window.status=\'go to ' +
			google_ads[i].visible_url + '\';return true">' +
			google_ads[i].visible_url + '</span></a><br>';

			}
			s += '<DIV ALIGN="RIGHT"><a href=\"' + google_info.feedback_url + '\" style="font-family:arial; font-size:11px;color:#949494;text-decoration:none; ">Ads by Google</a></DIV></DIV>';
			if (google_ads[0].bidtype == "CPC")
			{
// insert this snippet for each ad call
				google_adnum = google_adnum + google_ads.length;
			}
		}
	}
    document.write(s);
    return;
}
function check_advanced_search()
{
	var kw = document.searc.q.value;
	kw = kw.replace(/^\s+|\s+$/g,"");
	if (kw.length < 3)
	{
		error_message = "Please enter atleast 3 characters for search";
		alert(error_message);
		document.searc.q.focus();
		return false;
	}
	return true;
}
function check_advanced_search1()
{
	var kw = document.searc1.q.value;
	kw = kw.replace(/^\s+|\s+$/g,"");
	if (kw.length < 3)
	{
		error_message = "Please enter atleast 3 characters for search";
		alert(error_message);
		document.searc1.q.focus();
		return false;
	}
	return true;
}
function callgoogle()
{
google_ad_client = 'pub-8525015516580200'; // substitute your client_id (pub-#)
google_ad_channel = ad_channel;
google_ad_output = 'js';
google_max_num_ads = ads_count;
google_ad_type = 'text';
google_feedback = 'on';
google_skip = google_adnum; // insert this snippet for each ad call
}

mediaserver_width="160";
mediaserver_height="300";
mediaserver_location = "TOP1RIGHT";
mediaserver_useiframe = 1;
mediaserver_noadv = 1;
