//language converter

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;


function convertnew(pattern)
{

/////////////////////////////////////////////////////////////
// Script to use language convertor
// By Rohit
/////////////////////////////////////////////////////////////

	/// Configuration parameters //////////////
	var open_in_same_window = 0;
	//////////// End Of Configuration /////////////

	var my_location = unescape(document.location.toString());
	var new_location ='';
	var new_pattern = '';
	if (my_location.indexOf('translate_c?') != -1) {
		/// From google...
		var indexof_u = my_location.indexOf('u=');
		if (indexof_u == -1) {
			new_location = document.location;
		}
		else {
			var subs = my_location.substring(indexof_u, my_location.length);
			var ss = subs.split('&');
			new_location = ss[0].substring(2, ss[0].length);
		}
	}
	else {
		new_location = document.location;
	}

	indexof_p = pattern.indexOf('|');

	var isen = '';
	if (indexof_p == -1) {
		indexof_p1 = pattern.indexOf('><');
		if (indexof_p1 == -1) {
			new_pattern = pattern;
			if (pattern == 'en') {
				isen = 1;
			}
		}
		else {
			var psplit =pattern.split('><');
			new_pattern = psplit[0]+'|'+psplit[1];
			if (psplit[1] == 'en') {
				isen = 1;
			}
		}
	}
	else {
		var psplit = pattern.split('|');
		new_pattern = psplit[0]+'|'+psplit[1];
		if (psplit[1] == 'en') {
			isen = 1;
		}
	}

	var thisurl = '';
	if (isen == 1) {
		thisurl = new_location;
	}
	else {
		thisurl = 'http://translate.google.com/translate_c?langpair=' + new_pattern + "&u=" + new_location;
	}

	if (open_in_same_window == 1) {
		window.location.href = thisurl;
	}
	else {
		if (CanAnimate ){
			msgWindow=window.open('' ,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
			msgWindow.focus();
			msgWindow.location.href = thisurl;
		}
		else {
			msgWindow=window.open(thisurl,'subwindow','toolbar=yes,location=yes,directories=yes,status=yes,scrollbars=yes,menubar=yes,resizable=yes,left=0,top=0');
		}
	}
	
	
}

//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)) } } }();


var http_request;
var formname;
function addBookmark(title,url) {
	if (window.sidebar) {
		window.sidebar.addPanel("BizTradeShows.com", url,"");
	}
	else if( document.all ) {
		window.external.AddFavorite( url, "BizTradeShows.com");
	}
	else if(navigator.appName == 'Netscape') {
		alert('Press (CTRL-D) to bookmark this page.');
	}
	return false;
}
function validateit(theForm) {
	if(theForm.nl_name.value == 'Your name here')
	{
		alert("Kindly enter your name.");
		theForm.nl_name.focus();
		return false;
	}
	if(theForm.email.value == 'Your e-mail here')
	{
		alert("Kindly enter your e-mail.");
		theForm.email.focus();
		return false;
	}
	if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(theForm.email.value)))
	{
		alert("Invalid Email ID. Kindly enter the correct ID.");
		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 nl_name = document.theForm.nl_name.value;
	var nl_grp_id = document.theForm.nl_grp_id.value;
	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 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');}
	}

function openchild(thisurl,hgt)
{
	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;

	if ( CanAnimate )
	{
		if(typeof hgt == 'undefined')
		{
		msgWindow=window.open( '' ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=635,height=500,top=500,left=500');
		}
		else
		{
		msgWindow=window.open( "" ,"subwindow","toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=635,height="+hgt+",top=500,left=500");
		}

			msgWindow.focus();
			msgWindow.location.href = thisurl;
	}
	else
	{
		if(typeof hgt == 'undefined')
		{
		msgWindow=window.open( thisurl ,'subwindow','toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=635,height=500,top=500,left=500');
		}
		else
		{
		msgWindow=window.open( thisurl ,"subwindow","toolbar=no,location=no,directories=no,status=yes,scrollbars=yes,menubar=no,resizable=yes,width=635,height="+hgt+",top=500,left=500");
		}
	}
}

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 check_set_reminder(url,id,formobj)
{
	var Radio1 = '';
	var CheckBox1 = '';
	if(formobj.Radio1[0].checked)
	{
		Radio1 = 'MR';
	}
	if(formobj.Radio1[1].checked)
	{
		Radio1 = 'MS';
	}
	if (Radio1 == "")
	{
		alert ("Please fill Your Salute");

		return (false);
	}
	

	if (formobj.name1.value == "")
	{
		alert ("Please fill your Name");
		formobj.name1.focus();
		return (false);
	}


	if (formobj.email.value == "")
	{
		alert ("Please fill your Emai-ID");
		formobj.email.focus();
		return (false);
	}
	if(! (formobj.email.value == ""))
	{
		if (!(/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(formobj.email.value)))
		{
			alert('Your Email Id is Not in Correct Format'); 
			formobj.email.focus();
			return (false);
		}
	}


	if (formobj.days_prior.value == "---Select---")
	{
		alert ("Please select how many days prior you would like to receive the reminder");
		formobj.days_prior.focus();
		return (false);
	}

	if(formobj.CheckBox1.checked == true)
	{
		CheckBox1 = 'on';
	}
	if(formobj.CheckBox1.checked == false)
	{
		CheckBox1 = 'off';
	}

	callajaxpost(url,id,formobj);
}

function callajaxpost(url,id,formobj)
{
	http_request = false;
	ajaxdata_div_id = id;
	formname = formobj;


	var qstr = '';
	if(ajaxdata_div_id == 'email')
	{
		var at_to = formobj.at_to.value;
		var at_from = formobj.at_from.value;
		var at_msg = formobj.at_msg.value;
		var option = formobj.option.value;
		var which_page = formobj.which_page.value;
		var my_page = formobj.my_page.value;
		var flname = formobj.flname.value;

		qstr='at_to='+escape(at_to)+'&at_from='+escape(at_from)+'&at_msg='+escape(at_msg)+'&option='+escape(option)+'&which_page='+escape(which_page)+'&page='+escape(my_page)+'&flname='+escape(flname);
	}
	if(ajaxdata_div_id == 'setremind')
	{

		var Radio1 = '';
		var CheckBox1 = '';
		if(formobj.Radio1[0].checked)
		{
			Radio1 = 'Mr';
		}
		if(formobj.Radio1[1].checked)
		{
			Radio1 = 'Ms';
		}
		
		var name1 = formobj.name1.value;
		var email = formobj.email.value;
		var days_prior = formobj.days_prior.value;
		var option = formobj.option.value;
		var my_page = formobj.my_page.value;
		var flname = formobj.flname.value;
		var eventid = formobj.eventid.value;

		if(formobj.CheckBox1.checked == true)
		{
			CheckBox1 = 'on';
		}
		if(formobj.CheckBox1.checked == false)
		{
			CheckBox1 = 'off';
		}

		qstr='Radio1='+escape(Radio1)+'&name1='+escape(name1)+'&email='+escape(email)+'&days_prior='+escape(days_prior)+'&which_page='+'&option='+escape(option)+'&my_page='+escape(my_page)+'&flname='+escape(flname)+'&CheckBox1='+escape(CheckBox1)+'&eventid='+escape(eventid);
	}
	if(ajaxdata_div_id == 'travelform')
	{
		var s_name = formobj.s_name.value;
		var s_email = formobj.s_email.value;
// 		var s_organization = formobj.s_organization.value;
// 		var s_address = formobj.s_address.value;
// 		var s_city = formobj.s_city.value;
		var s_country = formobj.s_country.value;
// 		var s_zip = formobj.s_zip.value;
		var s_ccode = formobj.s_ccode.value;
		var s_acode = formobj.s_acode.value;
		var s_phone = formobj.s_phone.value;
		var TBL_LEAD_ARRIVAL_DATE = formobj.TBL_LEAD_ARRIVAL_DATE.value;
		var TBL_LEAD_ARRIVAL_MONTH = formobj.TBL_LEAD_ARRIVAL_MONTH.value;
		var TBL_LEAD_ARRIVAL_YEAR = formobj.TBL_LEAD_ARRIVAL_YEAR.value;
		var FK_TBL_DURATION_ID = formobj.FK_TBL_DURATION_ID.value;
		var FK_TBL_PEOPLE_ADULT_ID = formobj.FK_TBL_PEOPLE_ADULT_ID.value;
		var s_interesthotelres = formobj.s_interesthotelres.value;
		var s_interesttransport = formobj.s_interesttransport.value;
		var s_interestflights = formobj.s_interestflights.value;
		var s_interesttours = formobj.s_interesttours.value;
		var TBL_LEAD_DESCRIPTION = formobj.TBL_LEAD_DESCRIPTION.value;

		var option = formobj.option.value;
		var my_page = formobj.my_page.value;
		var flname = formobj.flname.value;
		var eventid = formobj.eventid.value;

		//qstr='s_name='+escape(s_name)+'&s_email='+escape(s_email)+'&s_organization='+escape(s_organization)+'&s_address='+escape(s_address)+'&s_city='+escape(s_city)+'&s_country='+escape(s_country)+'&s_zip='+escape(s_zip)+'&s_ccode='+escape(s_ccode)+'&s_acode='+escape(s_acode)+'&s_phone='+escape(s_phone)+'&TBL_LEAD_ARRIVAL_DATE='+escape(TBL_LEAD_ARRIVAL_DATE)+'&TBL_LEAD_ARRIVAL_MONTH='+escape(TBL_LEAD_ARRIVAL_MONTH)+'&TBL_LEAD_ARRIVAL_YEAR='+escape(TBL_LEAD_ARRIVAL_YEAR)+'&FK_TBL_DURATION_ID='+escape(FK_TBL_DURATION_ID)+'&FK_TBL_PEOPLE_ADULT_ID='+escape(FK_TBL_PEOPLE_ADULT_ID)+'&s_interesthotelres='+escape(s_interesthotelres)+'&s_interesttransport='+escape(s_interesttransport)+'&s_interestflights='+escape(s_interestflights)+'&s_interesttours='+escape(s_interesttours)+'&TBL_LEAD_DESCRIPTION='+escape(TBL_LEAD_DESCRIPTION)+'&which_page='+'&option='+escape(option)+'&my_page='+escape(my_page)+'&flname='+escape(flname)+'&eventid='+escape(eventid);


		qstr='s_name='+escape(s_name)+'&s_email='+escape(s_email)+'&s_country='+escape(s_country)+'&s_ccode='+escape(s_ccode)+'&s_acode='+escape(s_acode)+'&s_phone='+escape(s_phone)+'&TBL_LEAD_ARRIVAL_DATE='+escape(TBL_LEAD_ARRIVAL_DATE)+'&TBL_LEAD_ARRIVAL_MONTH='+escape(TBL_LEAD_ARRIVAL_MONTH)+'&TBL_LEAD_ARRIVAL_YEAR='+escape(TBL_LEAD_ARRIVAL_YEAR)+'&FK_TBL_DURATION_ID='+escape(FK_TBL_DURATION_ID)+'&FK_TBL_PEOPLE_ADULT_ID='+escape(FK_TBL_PEOPLE_ADULT_ID)+'&s_interesthotelres='+escape(s_interesthotelres)+'&s_interesttransport='+escape(s_interesttransport)+'&s_interestflights='+escape(s_interestflights)+'&s_interesttours='+escape(s_interesttours)+'&TBL_LEAD_DESCRIPTION='+escape(TBL_LEAD_DESCRIPTION)+'&which_page='+'&option='+escape(option)+'&my_page='+escape(my_page)+'&flname='+escape(flname)+'&eventid='+escape(eventid);
	}

	formobj.innerHTML = '<DIV STYLE="height:200px;" ALIGN="CENTER"><IMG SRC="/gifs/loading.gif"></DIV>';

	if (window.XMLHttpRequest)
	{
		http_request = new XMLHttpRequest();
		if (http_request.overrideMimeType)
		{
			http_request.overrideMimeType('text/xml');
		}
	}
	else if (window.ActiveXObject)
	{ // IE
		try
		{
			http_request = new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e)
		{
			try
			{
				http_request = new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e)
			{
				alert ("Your browser does not support AJAX!");
				return;
			}
		}
	}

	http_request.onreadystatechange=alertContents;
	http_request.open('POST',url,true);
	http_request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	http_request.send(qstr);
}

function alertContents()
{
	if (http_request.readyState == 4)
	{
		if (http_request.status == 200)
		{
			formname.innerHTML = http_request.responseText;
		}
		else
		{
			alert('There was a problem with the request.');
		}
	}
}

var xmlhttp

function GetXmlHttpObject()
{
	if (window.XMLHttpRequest)
	{
		// code for IE7+, Firefox, Chrome, Opera, Safari
		return new XMLHttpRequest();
	}
	if (window.ActiveXObject)
	{
		// code for IE6, IE5
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	return null;
}

function submitPaginationForm(i)
{
	document.pagination.p.value = i;
	document.pagination.submit();
}
function check_blank()
{
	if(document.b_frm.ss.value == '')
	{
		alert("Please fill the city name.");
		document.b_frm.ss.focus();
		return false;
	}
}

// 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+"\">");
}

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 openchilda(sPicURL) {
     window.open( "popup.html?"+sPicURL, "one", "resizable=1"); 
}
function load_external_script(url,id)
{
	var external_script = document.getElementById(id);
	external_script.src = url;
}
//Media4Trade js starts
var mediaserver_height="";
var mediaserver_width="";
var mediaserver_location="";
var mediaserver_contenttype="";
var mediaserver_id="";
var mediaserver_uname="";
var mediaserver_comp="";
var mediaserver_mcat="";
var mediaserver_cat="";
var mediaserver_grp="";
var mediaserver_cmpg="";
var mediaserver_kwd="";
var mediaserver_otherparam="";
var mediaserver_nomore=0;
var mediaserver_noadv=0;
var mediaserver_newwin=0;
var mediaserver_paidonly=0;
var mediaserver_useiframe=0;
var mediaserver_parentwindow=0;


function serve_ad(mycompid)
{

	var mediaserver_ad_url = 'http://www.media4trade.com/mediaserver?';
	var mediaserver_size = mediaserver_width+'x'+mediaserver_height;
	
	var mediaserver_pageurl;
	if(mediaserver_parentwindow == 1)
	{
		mediaserver_pageurl = parent.document.location;
	}
	else
	{
		mediaserver_pageurl = document.location;
	}
	

	mediaserver_ad_url += 'action=show';
	mediaserver_ad_url += '&pageurl=' + encodeURIComponent(mediaserver_pageurl);
	mediaserver_ad_url += '&location=' + mediaserver_location;
	mediaserver_ad_url += '&kwd=' + encodeURIComponent(mediaserver_kwd);
	mediaserver_ad_url += '&size=' + mediaserver_size;
	mediaserver_ad_url += '&contenttype=' + mediaserver_contenttype;
	mediaserver_ad_url += '&id=' + mediaserver_id;
	mediaserver_ad_url += '&uname=' + mediaserver_uname;
	
	if(mycompid)
	{
		mediaserver_ad_url += '&comp=' + mycompid;
	}
	else
	{
		mediaserver_ad_url += '&comp=' + mediaserver_comp;
	}
	
	mediaserver_ad_url += '&mcat=' + mediaserver_mcat;
	mediaserver_ad_url += '&cat=' + mediaserver_cat;
	mediaserver_ad_url += '&grp=' + mediaserver_grp;
	mediaserver_ad_url += '&cmpg=' + mediaserver_cmpg;
	mediaserver_ad_url += '&otherparam=' + encodeURIComponent(mediaserver_otherparam);
	mediaserver_ad_url += '&nomore=' + mediaserver_nomore;
	mediaserver_ad_url += '&noadv=' + mediaserver_noadv;
	mediaserver_ad_url += '&newwin=' + mediaserver_newwin;
	mediaserver_ad_url += '&paidonly=' + mediaserver_paidonly;

	if(mediaserver_contenttype == 'prdbanner') {mediaserver_noadv = 1;}
	
	if(mediaserver_useiframe)
	{
		if(!mediaserver_noadv)
		{
			mediaserver_height = parseInt(mediaserver_height)+20;
		}

		mediaserver_ad_url += '&iframe=1';
		document.write('<center><ifr'+'ame id="'+mediaserver_location+'" src="' + mediaserver_ad_url + '" width="'+mediaserver_width+'" height="'+mediaserver_height+'" frameborder="0" scrolling="no" marginwidth="0" marginheight="0" target="_top"></ifr'+'ame></center>');
	}
	else
	{
		mediaserver_ad_url += '&iframe=0';
		document.write('<center><scr'+'ipt type="text/javascript" src="' + mediaserver_ad_url + '"></scr'+'ipt></center>');
	}
}
//Media4Trade js ends

//google-custom-ad31.js Starts
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 = '',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:bold 12px arial; color:#555;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) {
			s += '<DIV><a href=\"' + google_info.feedback_url + '\" style="font:bold 11px arial; color:#555;text-decoration:none; padding:0 0 0 5px">Ads by Google</a></DIV><DIV style="background-color:#ffffff;padding:5px;line-height:15px;">'
			for(i = 0; i < google_ads.length; ++i) {
			if(i>0)
			{
				s += '<br>';
			}
			s += '<a style="font-family:arial;font-size:13px; 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 + ' : <BR></span> <span><a style="font-family:arial;font-size:10px;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>';
			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 submitPaginationForm(i)
{
	document.pagination.p.value = i;
	document.pagination.submit();
}
function gl()
{
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 */
}
//google-custom-ad31.js Ends

