/******************************************************************************************
// Author			: MTG Project Developers
// Organization     : Hcl Technologies Ltd.
// Date             : 18/03/2005
// Version No       : 1.0
// Last Updated on	: 28/03/2005

// Description		: This js file is maily used to write all javascript funtions at one place in 
// MyTravelGuide.com project so that we do not write js funtions on different jsp's.
//*******************************************************************************************/

// Variables Declared for MOD_0051_Photo_Large Photo Bundle

var myimages=new Array();  // for storing image url 
var	arrusername=new Array(); // for storing member_name
var arrhyes=new Array(); // for storing helpful yes
var arrhtotal=new Array(); // for storing helpful total
var arrblurb=new Array(); // for storing blurb
var arrobjid=new Array(); // for storing child objid
var arrimgtitle=new Array(); // for storing img title
var arrurl=new Array(); // for storing dest url
var arrseq=new Array(); // for storing img seq
var arroname=new Array(); // for  storing child obj name
var arrvdisp=new Array();
var arruid=new Array();
var arrtemp=new Array();
var startctr=0; //  this variable will store the starting point number of the image
				// i.e. the number from where to start thumnail display

var endctr=3;   //  this variable will store the end point number of the image
				// i.e. the number till which to thumnail display
var totimgs=0;   // this will store the total no. of images
var objname=""; // this will store the parent objname
var nextctr=0;  // this will store the current image counter i.e. the current selected image by the user 
var thumname=""; // the will store the tumbnail version of the image.
var photopagename="";
var Tripuserid="";
var BackUrl="";
var Tripid=""
var SessionUser="";
var lsRegExp = /\ /g;
var coachingWindow;
var adURLArray = new Array();
var popupBlockerOn = false;
var	poptop  = 5;
countWins = new Array();
openWins = new Array();
curWin = 0;
countWinsNew = new Array();
openWinsNew = new Array();
curWinNew = 0;
countHotelAdvertiser = new Array();
countCarAdvertiser	 = new Array();	
countFlightAdvertiser= new Array();	


//Start of functions for MOD_0051_Photo_Large Photo Bundle

//This function will be called when user has clicked yes or no link for poll
//will submit the form
function submit_form(submitval){
	var objvote=document.getElementById("vote");
	var objfeed= document.getElementById("feedback").style;
	if (submitval=="Y" || submitval=="N"){
		var sUrl="/common/photos/mod_0051_photo_poll.jsp?seq="+arrseq[nextctr]
				+"&objid="+arrobjid[nextctr]+"&hflag="+submitval;
		
		window.open( sUrl, "myWindow", 
		"status = 0, height =1, width =1, resizable = 0" );
		arrvdisp[nextctr]="N";

		//document.frmphoto.sorder.value="";
		if (submitval=="Y")
		{
			arrhyes[nextctr]=parseInt(arrhyes[nextctr])+1;
		}
		arrhtotal[nextctr]=parseInt(arrhtotal[nextctr])+1;
		objvote.innerHTML= '<p class="tip"> '+ arrhyes[nextctr] +' of '+ arrhtotal[nextctr] +' people recommended this photo.</p> ';
		objfeed.display="";
		
	}
	else{
		document.frmphoto.sorder.value=submitval;
		document.frmphoto.txtseq.value="";
		document.frmphoto.txtobjid.value="";
		document.frmphoto.submit();
	}	
	//DisplayThumbnails('S');
}

// this will derive the thumnail path and name of the image
function getThumbname(imgsrc)
{
	var img_arr=imgsrc.split("/");
	thumname="";
	for (ictr=0;ictr<img_arr.length;ictr++)
	{
		if (img_arr[ictr].indexOf(".")!=-1 && ictr==(img_arr.length-1))
		{
			thumname=thumname+img_arr[ictr].replace(".","_tn.");
		}
		else
		{
			thumname=thumname+img_arr[ictr]+"/";
		}
	}
}
// this will display the topmost label of the page like boston photos (1-4 of 50)
function DisplayLabel()
{
		var lblsctr=0;
		var lblectr=0;
		lblsctr=startctr+1;
		lblectr=endctr+1;
		if (lblectr > myimages.length )
		{	lblectr=totimgs;
		
		}
		var imgobj=document.getElementById("lbl");
		var strhtml="";

		if (photopagename=="photosfromuser")
		{
			strhtml="<h1> Research Photos from "+  unescape(objname)+ " <i>( " + lblsctr  + "-"+ lblectr + " of " + totimgs + ")</i></h1>";

		}

		if (photopagename=="myphotos")
		{
			strhtml="<h1> My Photos  <i>( " + lblsctr  + "-"+ lblectr + " of " + totimgs + ")</i></h1>";

		}
	
		if (photopagename=="tripphotos"||photopagename=="mytripphotos")
		{
				
				strhtml='<h1> Photos of <a href='+BackUrl+'> ' + unescape(objname)+' </a> <i> ( ' + lblsctr  + '-'+ lblectr + ' of ' + totimgs + ')</i></h1> '
					+'<p> from <b> '+ Tripuserid +' </b></p> ';
		}
		if (photopagename=="objphotodisplay"||photopagename=="destphotodisplay")
		{
			strhtml='<h1> ' + unescape(objname) + ' Photos <i> ( ' + lblsctr  + '-'+ lblectr + ' of ' + totimgs + ')</i></h1> ';
		}
		
		imgobj.innerHTML=strhtml;
		
}
//This function will display html for large image  , vote section , 
//user section , blurb section as this sections will varify depending on the image selected by the user
//so these will be needed to display dynomically
function DisplayImage(rctr){		
		var imgobj=document.getElementById("dynloadarea");
		var objuser=document.getElementById("frmuser");	
		var objblurb=document.getElementById("text");	
		var objvote=document.getElementById("vote");	
		var objfeed= document.getElementById("feedback").style;
		var upldtop=document.getElementById("uploadtop");
		var upldbottom=document.getElementById("uploadbottom");
		var strhtml="";
		var img			=	myimages[rctr].src;
		var username	=	arrusername[rctr];
		var blurb		=	arrblurb[rctr];
		var hyes		=	arrhyes[rctr];
		var htotal		=	arrhtotal[rctr];
		var objid		=	arrobjid[rctr];
		var imgtitle	=	arrimgtitle[rctr];
		var url			=	arrurl[rctr];
		var oname		=	arroname[rctr];
		var dispv		=	arrvdisp[rctr];
		var uid			=	arruid[rctr];
		var templ		=	arrtemp[rctr];
	
		objfeed.display="none";
		if (totimgs>1)
		{
			if (rctr==0)
			{
				if (unescape(imgtitle)!=null && unescape(imgtitle) !="")
				{
					strhtml=strhtml+' <img id= "placeholder" src="'+img+'" class="imgframe">  <br> ';
					strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a> &ndash;  '+ unescape(imgtitle) +' )</p> ';
					strhtml=strhtml+' &bull; <a href=javascript:DisplayThumbnails("NL")  class="alt">NEXT </a> &rarr; ';
					strhtml=strhtml+' </center> ';
				}
				else
				{
					strhtml=strhtml+' <img id= "placeholder" src="'+img+'" class="imgframe">  <br> ';
					strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a>) </p> ';
					strhtml=strhtml+' &bull; <a href=javascript:DisplayThumbnails("NL")  class="alt">NEXT </a> &rarr; ';
					strhtml=strhtml+' </center> ';
				}
			}
			else
			{
				if (rctr>=(myimages.length-1))
				{
					if (unescape(imgtitle)!=null && unescape(imgtitle) !="")
					{
						strhtml=strhtml+' <img id= "placeholder" src="'+img+'" class="imgframe" >  <br> ';
						strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a> &ndash;  '+ unescape(imgtitle) +' )</p> ';
						strhtml=strhtml+' &larr; <a href=javascript:DisplayThumbnails("PL")  class="alt" > PREV</a> &bull; ';
						strhtml=strhtml+' </center> ';
					}
					else
					{
						strhtml=strhtml+' <img id= "placeholder" src="'+img+'" class="imgframe" >  <br> ';
						strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a> )</p> ';
						strhtml=strhtml+' &larr; <a href=javascript:DisplayThumbnails("PL")  class="alt" > PREV</a> &bull; ';
						strhtml=strhtml+' </center> ';

					}
				}
				else
				{
					if (unescape(imgtitle)!=null && unescape(imgtitle) !="")
					{
						strhtml=strhtml+' <img id= "placeholder" src="'+img+'"  class="imgframe" >  <br> ';
						strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a> &ndash;  '+ unescape(imgtitle) +' )</p> ';
						strhtml=strhtml+' <a href=javascript:DisplayThumbnails("PL")  class="alt" >&larr; PREV</a> ';
						strhtml=strhtml+' &nbsp;&bull;&nbsp; <a href=javascript:DisplayThumbnails("NL")  class="alt">NEXT &rarr;</a> ';
						strhtml=strhtml+' </center> ';
					}
					else
					{
						strhtml=strhtml+' <img id= "placeholder" src="'+img+'"  class="imgframe" >  <br> ';
						strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a> )</p> ';
						strhtml=strhtml+' <a href=javascript:DisplayThumbnails("PL")  class="alt" >&larr; PREV</a> ';
						strhtml=strhtml+' &nbsp;&bull;&nbsp; <a href=javascript:DisplayThumbnails("NL")  class="alt">NEXT &rarr;</a> ';
						strhtml=strhtml+' </center> ';
					}
				}
			}
		}
		else
		{
			if (unescape(imgtitle)!=null && unescape(imgtitle) !="")
			{
					strhtml=strhtml+' <img id= "placeholder" src="'+img+'" class="imgframe" >  <br> ';
					strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a> &ndash;  '+ unescape(imgtitle) +' )</p> ';
					strhtml=strhtml+' </center> ';
			}
			else
			{
					strhtml=strhtml+' <img id= "placeholder" src="'+img+'" class="imgframe" >  <br> ';
					strhtml=strhtml+' <center> <p>( <a href="'+url+'" ><b>'+unescape(oname)+'</b></a>  )</p> ';
					strhtml=strhtml+' </center> ';
			}
		}
		imgobj.innerHTML=strhtml;
		if (username!=null && username!="")
		{

				if (photopagename=="destphotodisplay"||photopagename=="objphotodisplay" || photopagename=="tripphotos" || photopagename=="mytripphotos" )
				{
					if (parseInt(SessionUser)!=uid)
					{
						if(photopagename=="tripphotos" || photopagename=="mytripphotos")
						{
							strhtml='<p class="smaller">By <b> '+username+' </b>  &nbsp;&bull;&nbsp; '
							  +' <a href=/photos/photosfromuser-'+uid+'-'+username+'.html'+'  class="alt">View all photos by '+username+' </a>  ';
						}
						else{
							strhtml='<p class="smaller">By <b> '+username+' </b>  &nbsp;&bull;&nbsp; '
							  +' <a href=/photos/photosfromuser-'+unescape(objname).replace(lsRegExp,"_")+'-'+uid+'-'+username+'.html'+'  class="alt">View all photos by '+username+' </a>  ';
						}
					}
					else
					{
						strhtml='<p class="smaller">By <b> '+username+' </b>  &nbsp;&bull;&nbsp; '
							  +' <a href=/photos/myphotos.html  class="alt">View all photos by '+username+' </a>  ';
					}
					if (photopagename=="tripphotos" )
					{
						strhtml=strhtml+'<br><a href=/trips/tripfromuser-'+Tripid+'.html >See the rest of '+unescape(objname)+' </a> ';
					}
					if (photopagename=="mytripphotos" )
					{
						strhtml=strhtml+'<br><a href=/trips/managemytrip-'+Tripid+'.html >See the rest of '+unescape(objname)+' </a> ';
					}
					strhtml=strhtml+'</p>';
					objuser.innerHTML=strhtml;

				}
				else
				{
					objuser.innerHTML='<p class="smaller">By <b> '+username+' </b>  &nbsp; </p> ';
				
				}
		}
		else
		{
			objuser.innerHTML='<p class="smaller">By <b> MYTravelGuide user</b>&nbsp;</p> ';
		}
		if (unescape(blurb)!=null && unescape(blurb)!="")
		{
			objblurb.innerHTML='<p> &#8220'+unescape(blurb)+' &#8221</p>';
		}
		else if(unescape(blurb)=="")
		{
			objblurb.innerHTML='';
		}
		if (parseInt(htotal)>0)
		{
			if (arrvdisp[rctr]=="N")
			{
				objvote.innerHTML= '<p class="tip"> '+ hyes +' of '+ htotal +' people recommended this photo.</p> ';
			}
			else
			{
				objvote.innerHTML= '<p class="tip"> '+ hyes +' of '+ htotal +' people recommended this photo.<br> 		Would you recommend this photo? &rarr; <a href=javascript:submit_form("Y") >YES</a> / <a href=javascript:submit_form("N") >NO</a></p> ';
			}
		}
		else if (parseInt(htotal)==0)
		{
			
			if (arrvdisp[rctr]=="Y")
			{
				objvote.innerHTML= '<p class="tip">  Would you recommend this photo? &rarr; <a href=javascript:submit_form("Y") >YES</a> / <a href=javascript:submit_form("N") >NO</a></p> ';
			}
		}
		if  ((photopagename=="myphotos" || photopagename=="photosfromuser"||photopagename=="objphotodisplay"||photopagename=="destphotodisplay") 
			&& (templ=="ATTRACTION")
			)
		{
				strhtml=' <ul class="nomargin"> '
				+' <li class="photo">  <a href=javascript:window.open("/attractions/photoupload-'+objid+'.html","_self")>'
				
				+' Add your own photo of '+unescape(oname)+' </a></li> </ul> ';

		}
		if  ((photopagename=="myphotos" || photopagename=="photosfromuser"||photopagename=="objphotodisplay"||photopagename=="destphotodisplay") 
			&& (templ=="HOTEL" || templ=="CITY" || templ=="STATE" || templ=="COUNTRY")
			)
		{
				strhtml=' <ul class="nomargin"> '
				+' <li class="photo">  <a href=javascript:window.open("/hotels/photoupload-'+objid+'.html","_self")>'
				
				+' Add your own photo of '+unescape(oname)+' </a></li> </ul> ';

		}
		if  ((photopagename=="myphotos" || photopagename=="photosfromuser"||photopagename=="objphotodisplay"||photopagename=="destphotodisplay") 
			&& (templ=="RESTAURANT")
			)
		{
				strhtml=' <ul class="nomargin"> '
				+' <li class="photo">  <a href=javascript:window.open("/restaurants/photoupload-'+objid+'.html","_self")>'
				
				+' Add your own photo of '+unescape(oname)+' </a></li> </ul> ';

		}
		if (photopagename=="tripphotos")
		{
				strhtml=' <ul class="nomargin"> '
				+' <li class="photo">  <a href=javascript:window.open("/hotels/photoupload-'+objid+'.html","_self")>'
				
				+' Add your own photo of '+unescape(oname)+' </a></li> </ul> ';
		}
		if (photopagename=="mytripphotos")
		{
				strhtml=' <ul class="nomargin"> '
				+' <li class="photo">  <a href=javascript:window.open("/trips/photoupload-'+Tripid+'.html","_self")>'
			
				+' Add your own photo of '+unescape(objname)+' </a></li> </ul> ';
		}

		upldtop.innerHTML=strhtml;
		upldbottom.innerHTML=strhtml;
		nextctr=rctr;
		//document.frmphoto.txtobjid.value=objid;

	}
	// this function store the data into array once the page is loaded
	function cacheData
			(arrctr
			,imgsrc
			,cityname
			,userid
			,hyes
			,htotal
			,blurb
			,objid
			,imgtitle
			,url
			,seq
			,oname
			,vdisp
			,uid
			,templ
			)
	{
			myimages[arrctr]=new Image();
			myimages[arrctr].src=imgsrc;
			
			totimgs++;
			objname=cityname;
			arrusername[arrctr]=userid;
			arrhyes[arrctr]=hyes;
			arrhtotal[arrctr]=htotal;
			arrblurb[arrctr]=blurb;
			arrobjid[arrctr]=objid;
			arrimgtitle[arrctr]=imgtitle;
			arrurl[arrctr]= url;
			arrseq[arrctr]= seq;
			arroname[arrctr]=oname;
			arrvdisp[arrctr]=vdisp;
			arruid[arrctr]=uid;
			arrtemp[arrctr]=templ;
	}

	// This function will display the thumnails at runtime 
	// depending upon next and prev button clicked by the user.
	function DisplayThumbnails(actflag)
	{
		var strhtml="";
		var imgobj=document.getElementById("thumbnail");
		var objprev=document.getElementById("prev").style;
		var objnext=document.getElementById("next").style;
		var objfeed= document.getElementById("feedback").style;
		var loopctr=0;
		var dispthumb="N";
			objfeed.display="";
		if (actflag!="A")
		{
			objfeed.display="none";
		}
		if ((actflag=="N" && endctr<=(myimages.length-1)) ||	(actflag=="NL" && endctr<=(myimages.length-1)  && nextctr==endctr)) 
		{
			
			startctr=endctr+1;
			DisplayImage(startctr);
			
			endctr=endctr+4;
			while (startctr<=endctr)
			{
				
				if (startctr<myimages.length)
				{
					getThumbname(myimages[startctr].src);
					strhtml=strhtml+' <img title="Enlarge this photo" src = "'+thumname+'" ';
					strhtml=strhtml+' width="75" height="75" onmouseover=style.cursor="hand"; class="imgframe" '; 
					strhtml=strhtml+"   onClick=javascript:document.getElementById('feedback').style.display='none';DisplayImage("+startctr+")> " ;
					strhtml=strhtml+' ';
					startctr++;
					dispthumb="Y";
				}
				else
				{
					break;
				}
			}
			startctr=endctr-3;
			nextctr=startctr;
			/*if (endctr>=(myimages.length-1))
			{
				imgobj.innerHTML=strprev+' <td class="vamiddle center"> '+ strhtml+' </td> ';
			}
			else
			{
				imgobj.innerHTML=strprev+' <td class="vamiddle center"> '+ strhtml+' </td> '+strnext;
			}*/
		}
		if ((actflag=="P" && startctr>0 && endctr>3) 
			|| (actflag=="PL" && startctr>0 && endctr>3 && (nextctr==startctr)  ) 
			)
		{
		
			startctr=startctr-4;
			if (actflag=="P")
			{
					DisplayImage(startctr);
			}
			if (actflag=="PL" && nextctr>0 )
			{
				DisplayImage(nextctr-1);
			}
			endctr=endctr-4;			
			while (startctr<=endctr)
			{
					
				if (startctr>=0)
				{
					getThumbname(myimages[startctr].src);
					strhtml=strhtml+' <img title="Enlarge this photo" src = "'+thumname+'" ';
					strhtml=strhtml+'  width="75" height="75" onmouseover=style.cursor="hand"; class="imgframe" '; 
					strhtml=strhtml+" onClick=javascript:document.getElementById('feedback').style.display='none';DisplayImage("+startctr+")> " ;
					startctr++;
					dispthumb="Y";
				}
				else
				{
					break;
				}
			}
			startctr=endctr-3;
			if (actflag=="PL")
			{
				nextctr=endctr;
			}
			if (actflag=="P")
			{
				nextctr=startctr;
			}
			/*if (dispthumb=="Y")
			{
				if (startctr>0)
				{
					imgobj.innerHTML=strprev+' <td class="vamiddle center"> '+ strhtml+' </td> '+strnext;
				}
				else
				{
					imgobj.innerHTML=' <td class="vamiddle center"> '+ strhtml+' </td> '+strnext;
				}
			}*/
			
		}
		if (actflag=="A") 
		{
			DisplayImage(0);
			while (loopctr<4)
			{
				if (loopctr<myimages.length)
				{
				
					
					getThumbname(myimages[loopctr].src);
						strhtml=strhtml+' <img src = "'+thumname+'" ';
						strhtml=strhtml+' width="75" height="75" title="Enlarge this photo" onmouseover=style.cursor="hand"; class="imgframe" '; 
						strhtml=strhtml+"onClick=javascript:document.getElementById('feedback').style.display='none';DisplayImage("+loopctr+")> " ;
						//strhtml=strhtml+' ';
						dispthumb="Y";
						
				}
				loopctr++;
			}
			if ( document.frmphoto.txtobjid.value!="" && document.frmphoto.txtseq.value!="")
			{
				loopctr=0;
				
				while (loopctr<arrseq.length)
				{
					if ((document.frmphoto.txtseq.value==arrseq[loopctr]) && 
						 (document.frmphoto.txtobjid.value==arrobjid[loopctr])
					   )
					{
						DisplayImage(loopctr);
						nextctr=loopctr;
						if (loopctr>0)
						{
							if ((loopctr%4)==0)
							{
								startctr=loopctr;
								endctr=startctr+3;
								loopctr=endctr;
							}
							else
							{
								endctr=(parseInt((Math.ceil(loopctr/4)))*4)-1;
								startctr=endctr-3;
								loopctr=endctr;
							}
							if (loopctr >(myimages.length-1))
							{
								loopctr=myimages.length-1;
							}
							strhtml="";
							while (startctr<=loopctr)
							{
									
								if (startctr>=0)
								{
									getThumbname(myimages[startctr].src);
									strhtml=strhtml+' <img title="Enlarge this photo" src = "'+thumname+'" ';
									strhtml=strhtml+'  width="75" height="75" onmouseover=style.cursor="hand"; class="imgframe" '; 
									strhtml=strhtml+" onClick=javascript:document.getElementById('feedback').style.display='none';DisplayImage("+startctr+")> " ;
									startctr++;
									dispthumb="Y";
								}
								else
								{
									break;
								}
							}
							startctr=endctr-3;
							break;
						}
						else
						{
							break;
						}

					}
					loopctr++;
				}
			}
		}
		if (actflag=="NL" && nextctr<(myimages.length-1) && dispthumb=="N" )

		{
			if (nextctr==0) 
			{
				nextctr=startctr+1;

			}
			else
			{
				nextctr++;
			}
			if (nextctr<myimages.length)
			{
				DisplayImage(nextctr);
			}
		}

		if (actflag=="PL")
		{
			
			if (startctr>=0 && nextctr>=0 && dispthumb=="N" && nextctr!=startctr) 
			{
				nextctr--;
				if (nextctr>=0)
				{
					DisplayImage(nextctr);
				}

			}
		}
		if ( dispthumb=="Y" && totimgs>=1 )
		{
			if (endctr>=(myimages.length-1))
			{
				objnext.display="none";
				if(totimgs<=4)
					objprev.display="none";
				else
					objprev.display="";
				imgobj.innerHTML= strhtml;
			}
			else if ( startctr==0 )
			{
				imgobj.innerHTML= strhtml;
				//objnext.innerHTML=strnext;
				objnext.display="";
				objprev.display="none";

			}
			else
			{
				//objprev.innerHTML=strprev;
				objprev.display="";
				imgobj.innerHTML=strhtml;
				//objnext.innerHTML=strnext;
				objnext.display="";

			}
			DisplayLabel();
		}
		else if ( dispthumb=="Y" && totimgs<=1 )
		{
			objprev.display="none";
			objnext.display="none";			
			imgobj.innerHTML= strhtml;
		}
	}
//End of functions for MOD_0051_Photo_Large Photo Bundle

// mod_0018_a_page_links.jsp  and mod_0018_page_links.jsp
	function addbookmark(bookmarkurl,bookmarktitle){
		if (document.all)
		   window.external.AddFavorite(bookmarkurl,bookmarktitle)
		else if(navigator.appName=="Netscape") 	
		   alert("Sorry. Netscape Users must Bookmark the page manually by pressing <Ctrl+D> OR by click <Bookmarks | Bookmark This Page>");
		else if( window.opera && window.print )   
			return true; 		
	}
// End of mod_0018

// Start of common/mod_sort_list.jsp
	function subSortForm(sortParam){
				document.sortForm.sortCriteria.value = sortParam;
				document.sortForm.submit();
	}
// End of mod_sort_list

// Start of mod_0020_hotel_lsiting.jsp and mod_0036_attraction_listing.jsp
	function priceCheck(preval,newVal){
		var screenW = screen.width;
		var screenH = screen.height;
		var width =  700 ;
		var height = 560;
		var left = screenW - width - 10;
		var slink = "/global/quicktrippopup.jsp?objectid="+preval+"&pagename="+ newVal; 
        window.open(slink,'PriceCheck','scrollbars=yes,toolbar=no,width='+ width + ',height='+ height + ',left='+ left + ',top=5,screenX='+ left + ',screenY=5')
    }
    function subForm(preVal){
		document.myform.preNext.value = preVal;
		document.myform.submit();
    }
    function hotelListingForm(){
		document.hotelListingForm.submit();
    }
	function createReviewFormHotRestAttr(preVal){
		document.reviewDisplayRest.action = preVal;
		document.reviewDisplayRest.submit();
    }
// End of mod_0020_hotel_lsiting.jsp

// Start of mod_0005_email_alert_popup.jsp and common/user/mod_login_personalize.jsp
	function submitPageEmailPopup(sURL){
		document.emailalertform.action =sURL;
		document.emailalertform.submit();
	}	
// End of mod_0005_email_alert_popup.jsp

// Start of mod_0006_footer.jsp
	function openHelpPopup(){
		var helplink = "/global/help.html";
		window.open(helplink,'Help','scrollbars=yes,toolbar=no,width=600,height=650')
	}
// End of mod_0006_footer.jsp

// Start of  mod_0009_my_recently_viewed.jsp
	function submitPage(sURL){
		document.fTRecentlyViewed.iItemsToDisplay.value = "15";
		document.fTRecentlyViewed.action =sURL;
		document.fTRecentlyViewed.submit();
	}
// End of  mod_0009_my_recently_viewed.jsp

// Start of mod_0012_c_geographic_listing.jsp and mod_0012_c_geographic_listing_home.jsp
	function submitHomeSearchPage(){	
		document.homesearchform.submit();
	}
// End of mod_0012_c_geographic_listing.jsp

// Start of mod_0012_geographic_listing.jsp
	function ViewAll(){
		document.frmGeo.flag.value = "true";
		document.frmGeo.submit();
	}
// End of mod_0012_geographic_listing.jsp

// Start of mod_0015_b_commerce_links.jsp and mod_0015_commerce_links.jsp
	function priceCheckForm(quicktripUrl,pageName,pageObjectId){
		var slink = quicktripUrl+'&pagename='+pageName+'&pageobjid='+pageObjectId;
		window.open(slink,'PriceCheck','scrollbars=yes,toolbar=no,width=250,height=600,left=5,top=5,screenX=5,screenY=5');
    }
// End of mod_0015_b_commerce_links.jsp 

// Start -  common function for various jsp's
	function partnerSitePrices(servleturl,windowId){
		window.open(servleturl,windowId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800 height=600');
	}
	function fPartnerSite(servleturl,windowId){
		window.open(servleturl,windowId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800 height=600')
	}
// End of mod_0015_c_commerce_links.jsp

// Start of mod_0021_b_user_review.jsp
	function subFormb(preVal){
		document.subFormb.preNext.value = preVal;
		document.subFormb.submit();
	}
	function createReviewForm(){
		document.reviewDisplay.submit();
	}
	function displayMessage(value,reviewId,i){
		document.getElementById('voteReview'+i).style.display='none';
		document.getElementById('displayMessage'+i).style.display='block';
		var option = "toolbar=no,width=1,height=1,left=" + (screen.width-50) + ",top=" + (screen.height-50) + ",status=no,scrollbars=no,resizable=no";
		var url = "/common/mod_update_review_count.jsp?add="+value+"&reviewId="+reviewId;
		window.open(url,"UpdateCount",option);
	}
// End of mod_0021_b_user_review.jsp

// Start of mod_0021_c_user_reviews.jsp
	function helpPage(preval){
	   var slink = "/global/help.html#"+preval; 
	   window.open(slink,'helppage','scrollbars=yes,toolbar=no,width=600,height=650')
	}
	function submitButtonPressed1(siteUrl){
		document.review.submitButton.disabled = true;
		document.review.firstTime.value = true;
		document.review.action = siteUrl;
		document.review.submit();
	}
	function cancelButtonPressed(redirectUrl){
		document.review.firstTime.value = false;
		document.review.action = redirectUrl;
		document.review.submit();
	}
// End of mod_0021_c_user_reviews.jsp

// Start of mod_0021_user_review.jsp
	function createUserReviewForm(){
		document.reviewDisplay.submit();
	}
// End of mod_0021_user_review.jsp

// Start of mod_0022_c_research_links.jsp , mod_0022_d_research_links.jsp and mod_0022_research_links.jsp , mod_0028_travel_guide_articles_listing.jsp 
	function researchLinkPopup(servletUrl){
		var slink = servletUrl;
		window.open(slink,'ResearchLinkPage','menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600')
	}
// End of mod_0022_c_research_links.jsp

//Start of  mod_top_ten_flight_car_cruise_vacation.jsp
	function resourceLinkPopup(servletUrl){
		var slink = servletUrl;
		window.open(slink,'ResourceLinkPage','menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600')
	}
	function partnerLinkPopup(servletUrl,pageName){
		var slink = servletUrl;
		window.open(slink,pageName,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600')
	}
// End of mod_top_ten_flight_car_cruise_vacation.jsp

// Start of mod_0023_hotel_header.jsp 
	function hotelHeaderForm(mapUrl){
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open('" + mapUrl + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=525,height=515');");
    }
	function createReviewHotelHeader(){
		document.createReviewHotelHeader.submit();
	}
	function addHotelToFavorite(){
	  	document.addHotelToFavorite.submit();
	}
    function openRegisterFromHotelFav(){
		document.openRegisterFromHotelFav.submit();
    }
	function expandMore(){
		document.getElementById('more').style.display='none';
		document.getElementById('less').style.display='block';
	}
	function compressLess(){
		document.getElementById('more').style.display='block';
		document.getElementById('less').style.display='none';
	}
// End of mod_0023_hotel_header.jsp

// Start of mod_0025_attraction_header.jsp 
	function attractionMap(mapUrl){
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open('" + mapUrl + "', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=525,height=515');");
    }
	function createReviewAttractionHeader(){
		document.createReviewAttractionHeader.submit();
    }
	function openWebSite(website){
		window.open(website,'newwebpage','')
	}
	function addAttractionToFavorite(){
		document.addAttractionToFavorite.submit();
	}
	function openRegisterFromAttrFav(){
		document.openRegisterFromAttrFav.submit();
	}
// End of mod_0025_attraction_header.jsp 

// Start of mod_0026_top_hotels_side_nav_listing.jsp 
	function navForm(preVal){
		document.navform.check.value = preVal;
        document.navform.submit();
    }
// End of mod_0026_top_hotels_side_nav_listing.jsp 

// Start of mod_0036_attraction_listing.jsp
	function attractionsMap(){
		document.attractionsMap.submit();
    }
	function reloadAttractions(reLoad){
		document.reloadData.displayFilterResults.value = "filterResults";
		document.reloadData.displayForSearch.value = "";
		//if(reLoad == "reloadFilter"){
			document.reloadData.submit();
		//}
	}
	function reloadForSearch(reLoad){
		document.reloadData.displayForSearch.value = "searchResults";
		document.reloadData.displayFilterResults.value = "";
		//if(reLoad == "reloadSearch"){
			document.reloadData.submit();
		//}
	}
// End of mod_0036_attraction_listing.jsp

// Start of mod_0038_Restaurant_listing.jsp
	function restNavForm(preVal){
		document.restform.preNext.value = preVal;
        document.restform.submit();
    }
	function restaurantsMap(){
		document.restaurantsMap.submit();
    }
	function reloadRestaurants(reLoad){
		document.reloadData.displayFilterResults.value = "filterResults";
		document.reloadData.displayForSearch.value = "";
		//if(reLoad == "reloadFilter"){
			document.reloadData.submit();
		//}
	}
// End of mod_0038_Restaurant_listing.jsp

// Start of mod_0039_Restaurant_header.jsp
	function restaurantMap(mapUrl){
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open('"+mapUrl+"', '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=525,height=515');");
    }
	function createReviewRestaurantHeader(){
		document.createReviewRestaurantHeader.submit();
    }
	function addRestaurantToFavorite(){
		document.addRestaurantToFavorite.submit();
	}
	function openRegisterFromRestFav(){
		document.openRegisterFromRestFav.submit();
	}
// End of mod_0039_Restaurant_header.jsp

// Start of mod_0043_mappoint_map_display.jsp , mod_0043_mappoint_map_display_single.jsp
	function popUp(URL) {
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=575,height=675');");
	}
// End of mod_0043_mappoint_map_display.jsp

// Start of common/flights/mod_flights_home.jsp 
	function changeAirport(){	
		 document.QuickPickFlights.submit();
	}
	function partnerSiteHome(slink,winId){	    
		var depcity=document.QuickPickFlights.departing_city.value;			
		depcity = trim(depcity);	
		var servleturl = slink+"&mtg_depct="+depcity+"&mtg_numtikt="+document.QuickPickFlights.num_tickets.options[document.QuickPickFlights.num_tickets.selectedIndex].text+"&mtg_depdt="+document.QuickPickFlights.DepartureDate.value+"&mtg_retdt="+document.QuickPickFlights.ReturnDate.value;
		window.open(servleturl,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
	}
	function partnerSiteHomeflight(slink,winId){	   
		var depcity=document.QuickPickFlights.departing_city.value;			
		depcity = trim(depcity);	
		var servleturl = slink+"&mtg_depct="+depcity+"&mtg_numtikt="+document.QuickPickFlights.num_tickets.options[document.QuickPickFlights.num_tickets.selectedIndex].text+"&mtg_depdt="+document.QuickPickFlights.pickupdate.value+"&mtg_retdt="+document.QuickPickFlights.dropoffdate.value;
		window.open(servleturl,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
	}
	// added new function for faresaver implementation on home page
	function partnerSiteHomeURL(slink,winId){
		var depcity=document.QuickPickFlights.departing_city.value;	
		depcity = trim(depcity);	
		var radSel=document.QuickPickFlights.radio_selected.value;

		var servleturl = slink+"&mtg_depct="+depcity+"&mtg_numtikt="+document.QuickPickFlights.num_tickets.value+"&mtg_depdt="+document.QuickPickFlights.DepartureDate.value+"&mtg_retdt="+document.QuickPickFlights.ReturnDate.value+"&mtg_radiosel="+radSel;
		window.open(servleturl,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
	}
	
	function updateDependentDateHome(firstdate,seconddate,sOffset){
		var date1 = new Date(firstdate);
		var date2 = new Date(seconddate);	
		if(isNaN(date1)){
			return;
		}
		var newdate = getNewDate(firstdate, sOffset);
		if(isNaN(date2)){
			document.QuickPickFlights.ReturnDate.value = newdate;
			return;
		}
		if(date1 >= date2){
			document.QuickPickFlights.ReturnDate.value = newdate;
			return;
		}
	}
// End of common/flights/mod_flights_home.jsp 
// Start of common/flights/mod_airfare_deals.jsp 
	function changeDeparting(){	
		document.QuickPickAirlinesForm.submit();
	}
	function partnerSite(slink,winId){
		var depcity=document.QuickPickAirlinesForm.depart_city.value;	
		depcity = trim(depcity);
		var servleturl = slink+"&mtg_depct="+depcity+"&mtg_numtikt="+document.QuickPickAirlinesForm.num_tickets.options[document.QuickPickAirlinesForm.num_tickets.selectedIndex].text+"&mtg_depdt="+document.QuickPickAirlinesForm.Flight_date_departure_CTL.value+"&mtg_retdt="+document.QuickPickAirlinesForm.Flight_date_return_CTL.value;
		window.open(servleturl,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');	
	}
	function updateDependentDate(firstdate,seconddate,sOffset){
		var date1 = new Date(firstdate);
		var date2 = new Date(seconddate);	
		if(isNaN(date1)){
			return;
		}
		var newdate = getNewDate(firstdate, sOffset);
		if(isNaN(date2)){
			document.QuickPickAirlinesForm.ReturnDate.value = newdate;
			return;
		}
		if(date1 >= date2){
			document.QuickPickAirlinesForm.ReturnDate.value = newdate;
			return;
		}
	}	
// End of common/flights/mod_airfare_deals.jsp 

// Start of common/cars/mod_cars_home.jsp 
function changeCityAirport(){	
     document.QuickPickCars.submit();
}
function updateDependentDateCars(firstdate,seconddate,sOffset){
	var date1 = new Date(firstdate);
	var date2 = new Date(seconddate);	
	if(isNaN(date1)){
		return;
	}
	var newdate = getNewDate(firstdate, sOffset);
	if(isNaN(date2)){
		document.QuickPickCars.dropoffdate.value = newdate;
		return;
	}
	if(date1 >= date2){
		document.QuickPickCars.dropoffdate.value = newdate;
		return;
	}
}
function RCarsPartnerSite(siteurl,windId){		window.open(siteurl,windId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
}
function CarsPartnerSite(slink,winId){
	var servletcall = slink+"&mtg_pickdt="+document.QuickPickCars.pickupdate.value+"&mtg_picktm="+document.QuickPickCars.pickuptime.options[document.QuickPickCars.pickuptime.selectedIndex].text+"&mtg_dropdt="+document.QuickPickCars.dropoffdate.value+"&mtg_droptm="+document.QuickPickCars.dropofftime.options[document.QuickPickCars.dropofftime.selectedIndex].text;	window.open(servletcall,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
}
// End of common/cars/mod_cars_home.jsp 
// Start of common/cars/mod_city_rental_car_deals.jsp 
function updateDependentDateCTCars(firstdate,seconddate,sOffset){
	var date1 = new Date(firstdate);
	var date2 = new Date(seconddate);	
	if(isNaN(date1)){
		return;
	}
	var newdate = getNewDate(firstdate, sOffset);
	if(isNaN(date2)){
		document.QuickPickCarForm.dropoffdate.value = newdate;
		return;
	}
	if(date1 >= date2){
		document.QuickPickCarForm.dropoffdate.value = newdate;
		return;
	}
}
function CTCarsPartnerSite(siteurl,windId){
	window.open(siteurl,windId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
}
function CTRentalCarsPartnerSite(slink,winId){
	var servletcall = slink+"&mtg_pickdt="+document.QuickPickCarForm.Flight_date_departure_CTL.value+"&mtg_picktm="+document.QuickPickCarForm.pickuptime.options[document.QuickPickCarForm.pickuptime.selectedIndex].text+"&mtg_dropdt="+document.QuickPickCarForm.Flight_date_return_CTL.value+"&mtg_droptm="+document.QuickPickCarForm.dropofftime.options[document.QuickPickCarForm.dropofftime.selectedIndex].text;	window.open(servletcall,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
 }
// End of common/cars/mod_city_rental_car_deals.jsp 
// Start of common/cruises/mod_cruise_home.jsp
	function ChangeCruise(){	
		 document.cruiseform.submit();
	}
	function OpenSite(slink){			window.open(slink,'CruiseLine','menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');
	}
	function CruisePartner(slink,windowId){
	var servleturl = slink+"&mtg_objname="+document.cruiseform.places.options[document.cruiseform.places.selectedIndex].text;	
	window.open(servleturl,windowId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
	}
// End of common/cruises/mod_cruise_home.jsp

// Start of common/vacations/mod_vacations_home.jsp 
function changeCTAirport(){	
     document.vacationsform.submit();
}
function updateDependentDateVacHome(firstdate,seconddate,sOffset){
	var date1 = new Date(firstdate);
	var date2 = new Date(seconddate);	
	if(isNaN(date1)){
		return;
	}
	var newdate = getNewDate(firstdate, sOffset);
	if(isNaN(date2)){
		document.vacationsform.return_date.value = newdate;
		return;
	}
	if(date1 >= date2){
		document.vacationsform.return_date.value = newdate;
		return;
	}
}
function VacationsPartnerSite(slink,winId){
		var fromcity=document.vacationsform.from.value;	
		fromcity = trim(fromcity);	
		var servleturl = slink+"&mtg_depct="+fromcity+"&mtg_numtraveler="+document.vacationsform.num_travelers.options[document.vacationsform.num_travelers.selectedIndex].text+"&mtg_depdt="+document.vacationsform.depart_date.value+"&mtg_retdt="+document.vacationsform.return_date.value;
		window.open(servleturl,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
}
// End of common/vacations/mod_vacations_home.jsp 

// Start of global/doubleclick.jsp
   /**
	 * Sets a Cookie with the given name and value.
	 *
	 * name       Name of the cookie
	 * value      Value of the cookie
	 * [expires]  Expiration date of the cookie (default: end of current session)
	 * [path]     Path where the cookie is valid (default: path of calling document)
	 * [domain]   Domain where the cookie is valid
	 *              (default: domain of calling document)
	 * [secure]   Boolean value indicating if the cookie transmission requires a
	 *              secure transmission
	 */
	function setCookie(name, value, expires, path, domain, secure)
	{
		document.cookie= name + "=" + escape(value) +
			((expires) ? "; expires=" + expires.toGMTString() : "") +
			((path) ? "; path=" + path : "") +
			((domain) ? "; domain=" + domain : "") +
			((secure) ? "; secure" : "");
	}

	/**
	 * Gets the value of the specified cookie.
	 *
	 * name  Name of the desired cookie.
	 *
	 * Returns a string containing value of specified cookie,
	 *   or null if cookie does not exist.
	 */
	function getCookie(name)
	{
		var dc = document.cookie;
		var prefix = name + "=";
		var begin = dc.indexOf("; " + prefix);
		if (begin == -1)
		{
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		}
		else
		{
			begin += 2;
		}
		var end = document.cookie.indexOf(";", begin);
		if (end == -1)
		{
			end = dc.length;
		}
		return unescape(dc.substring(begin + prefix.length, end));
	}

	/**
	 * Deletes the specified cookie.
	 *
	 * name      name of the cookie
	 * [path]    path of the cookie (must be same as path used to create cookie)
	 * [domain]  domain of the cookie (must be same as domain used to create cookie)
	 */
	function deleteCookie(name, path, domain)
	{
		if (getCookie(name))
		{
			document.cookie = name + "=" + 
				((path) ? "; path=" + path : "") +
				((domain) ? "; domain=" + domain : "") +
				"; expires=Thu, 01-Jan-70 00:00:01 GMT";
		}
	}
    function PopInit(append){ 
		domainCheck(append); 
	} 
	function domainCheck(append){
		var sTest = ""; 
		try{ 
			sTest = window.opener.document.domain; 
		}
		catch(e){ 
			sTest = "";
			setCookie("popup_displayed", "true", "", "/", "", "");
		}
		if( (sTest == "") || (sTest == "undefined") ){
			if(append == "air"){
				this.window.resizeTo(310,280);
			}
			else if(append == "HomePages"){
				this.window.resizeTo(475,185); 
			}
			else{
				this.window.resizeTo(600,470); 
			}
			var x = ((screen.width-500)/2)-(300/2);
			var y = (screen.height-350-(300/2));
			this.window.moveTo(y,x);
			this.window.resizable=0;
			this.window.focus(); 
		}
		else{ 
			this.window.close(); 
		} 
	} 
// End of global/doubleclick.jsp

// Start of pricecheckredirect.jsp and quicktrippopup.jsp
	function IsPopupBlocker() {
		var oWin = window.open("","testpopupblocker","outerheight=1,height=1,innerheight=1,outerWidth=1,width=1,innerWidth=1,top=7000,resizable,scrollbars,status");
		if (oWin==null || typeof(oWin)=="undefined") {
			return true;
		} else {
			oWin.close();
			return false;
		}
	}
// End of pricecheckredirect.jsp

// Start of quicktrippopup.jsp
	function updateDependentDateQuicktrip(firstdate,seconddate,sOffset){
		var date1 = new Date(firstdate);
		var date2 = new Date(seconddate);	
		if(isNaN(date1)){
			return;
		}
		var newdate = getNewDate(firstdate, sOffset);
		if(isNaN(date2)){
			document.superpricecheck.hotels_date_checkout_CTL.value = newdate;
			return;
		}
		if(date1 >= date2){
			document.superpricecheck.hotels_date_checkout_CTL.value = newdate;
			return;
		}
	}
	function commercePopup(servletUrl,newWinId){
		var slink = servletUrl;
		window.open(slink,newWinId,'left='+x1+',top='+y1+',screenX='+x1+',screenY='+y1+',menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
		setParameter();
	 }
	 function commercePopupNew(servletUrl,newWinId){
		var slink = servletUrl;
		window.open(slink,newWinId,'left=5,top=5,screenX=40,screenY=20,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
	 }
	 
	 function commercePopupPriceCheck(servletUrl,newWinId){
		var numberOfGuests = document.superpricecheck.number_of_guests.value;
		var numberOfRooms = document.superpricecheck.number_of_rooms.value;
		var checkinDate = document.superpricecheck.hotels_date_checkin_CTL.value;
		var checkoutDate = document.superpricecheck.hotels_date_checkout_CTL.value;
		var dCheckinDate = new Date(checkinDate);
		var dCheckoutDate = new Date(checkoutDate);
		var difference = dCheckoutDate - dCheckinDate;
		var days = Math.round(difference/(1000*60*60*24));
		var slink = servletUrl + "&mtg_cindt=" + checkinDate + "&mtg_coutdt="+checkoutDate + "&mtg_numnight="+days+"&mtg_numguest="+numberOfGuests+"&mtg_numroom="+numberOfRooms;
		window.open(slink,newWinId,'left='+x1+',top='+y1+',screenX='+x1+',screenY='+y1+',menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
		setParameter();
	  }
	  
//added for faresaver implementation

 function commercePopupPriceCheckUrl(servletUrl,newWinId){
 		var numberOfGuests;
 		if(document.hotelsForm.adults!=null)
			numberOfGuests = document.hotelsForm.adults.value;
		else
			numberOfGuests = 2;
		var numberOfRooms = document.hotelsForm.number_of_rooms.value;
		var checkinDate = document.hotelsForm.checkindate.value;
		var checkoutDate = document.hotelsForm.checkoutdate.value;
		var dCheckinDate = new Date(checkinDate);
		var dCheckoutDate = new Date(checkoutDate);
		var difference = dCheckoutDate - dCheckinDate;
		var days = Math.round(difference/(1000*60*60*24));
		var slink = servletUrl + "&hotel_country_name="+"&mtg_cindt=" + checkinDate + "&mtg_coutdt="+checkoutDate + "&mtg_numnight="+days+"&mtg_numguest="+numberOfGuests+"&mtg_numroom="+numberOfRooms;
		window.open(slink,newWinId,'left=5,top=5,screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
		
	  }	  
	  
function CarsPartnerSiteUrl(slink,winId){
	var servletcall = slink+"&mtg_pickdt="+document.carsForm.pickupdate.value+"&mtg_picktm="+document.carsForm.pickuptime.value+"&mtg_dropdt="+document.carsForm.dropoffdate.value+"&mtg_droptm="+document.carsForm.dropofftime.value;	window.open(servletcall,winId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
}

/// ended faresaver implementation
// End of quicktrippopup.jsp
	function submitQuickTrip(val){
		for( var i=0; i<document.superpricecheck.elements.length; i++){
			if(document.superpricecheck.elements[i].checked){
				document.superpricecheck.submit();
				return true;
			}
		}
		alert("Select a Site for Comparison");
		return false;
	}
	function handleEnter(event,newval){
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) submitQuickTrip(newval);
	}

// End of quicktrippopup.jsp

// Start of mod_0043_mappoint_map_display_interactive.jsp
	function RoundTo2dp(X){
		return Math.round(X*100)/100;
	}
	function assignZoomLevel(level,imgName,siteUrl){
		if(check == 0){
			if(document[imgName].src == eval(imgName + "replace.src")){
				document[imgName].src = eval(imgName + "replace.src");       
			}
			else{
				document.mapPopup.imageValue.value = imgName;
				document.mapPopup.fZoomLevel.value = level;
				check = check + 1;
				document.mapPopup.action = siteUrl;
				document.mapPopup.submit();
			}
		}
	}
	function assignPanning(pan,siteUrl){
		if(check == 0){
			if(pan == 2){
				document.mapPopup.fPanHorizontal.value = RoundTo2dp( parseFloat(document.mapPopup.fPanHorizontal.value)  + parseFloat(fractionFactor));
			}
			else if(pan == -2){
				document.mapPopup.fPanHorizontal.value = RoundTo2dp(parseFloat(document.mapPopup.fPanHorizontal.value)  - parseFloat(fractionFactor));
			}
			else if(pan == 1){
				document.mapPopup.fPanVertical.value = RoundTo2dp(parseFloat(document.mapPopup.fPanVertical.value)  + parseFloat(fractionFactor));
			}
			else if(pan == -1){
				document.mapPopup.fPanVertical.value = RoundTo2dp(parseFloat(document.mapPopup.fPanVertical.value)  - parseFloat(fractionFactor));
			}
			check = check + 1;
			document.mapPopup.action = siteUrl;
			document.mapPopup.submit();
		}
	}
	function assignHVPanning(vPan,hPan,siteUrl){
		if(check == 0){
			if(vPan == 1 && hPan == 1){
				document.mapPopup.fPanVertical.value = RoundTo2dp( parseFloat(document.mapPopup.fPanVertical.value)  + parseFloat(fractionFactor));
				document.mapPopup.fPanHorizontal.value = RoundTo2dp( parseFloat(document.mapPopup.fPanHorizontal.value)  + parseFloat(fractionFactor));
				
			}
			else if(vPan == 1 && hPan == -1){
				document.mapPopup.fPanVertical.value = RoundTo2dp( parseFloat(document.mapPopup.fPanVertical.value)  + parseFloat(fractionFactor));
				document.mapPopup.fPanHorizontal.value = RoundTo2dp( parseFloat(document.mapPopup.fPanHorizontal.value)  - parseFloat(fractionFactor));
			}
			else if(vPan == -1 && hPan == 1){
				document.mapPopup.fPanVertical.value = RoundTo2dp( parseFloat(document.mapPopup.fPanVertical.value)  - parseFloat(fractionFactor));
				document.mapPopup.fPanHorizontal.value = RoundTo2dp( parseFloat(document.mapPopup.fPanHorizontal.value)  + parseFloat(fractionFactor));
			}
			else if(vPan == -1 && hPan == -1){
				document.mapPopup.fPanVertical.value = RoundTo2dp( parseFloat(document.mapPopup.fPanVertical.value)  - parseFloat(fractionFactor));
				document.mapPopup.fPanHorizontal.value = RoundTo2dp( parseFloat(document.mapPopup.fPanHorizontal.value)  - parseFloat(fractionFactor));
			}
			check = check + 1;
			document.mapPopup.action = siteUrl;
			document.mapPopup.submit();
		}
	}
	function increaseZoomLevel(level,siteUrl){
		if(check == 0){
			if(document.mapPopup.fZoomLevel.value  != 1){
				var calImageVal = startOfImageName + (zoomLevelLength*1) - (document.mapPopup.fZoomLevel.value*1) + 1 ;
				actualImageVal = "img"+calImageVal
				document.mapPopup.imageValue.value = actualImageVal;
				document.mapPopup.fZoomLevel.value = (document.mapPopup.fZoomLevel.value*1)  - (level);
				check = check + 1;
				document.mapPopup.action = siteUrl;
				document.mapPopup.submit();
			}
			else{
				document.mapPopup.img2.disabled=true;
			}
		}
	}
	function decreaseZoomLevel(level,siteUrl,dZoomScalesLength){
		if(check == 0){
			if(document.mapPopup.fZoomLevel.value  != dZoomScalesLength){
				var calImageVal = startOfImageName + (zoomLevelLength*1) - (document.mapPopup.fZoomLevel.value*1) - 1 ;
				actualImageVal = "img"+calImageVal
				document.mapPopup.imageValue.value = actualImageVal;
				document.mapPopup.fZoomLevel.value = (document.mapPopup.fZoomLevel.value*1) + (level);
				check = check + 1;
				document.mapPopup.action = siteUrl;
				document.mapPopup.submit();
			}
			else{
				document.mapPopup.img1.disabled=true;
			}
		}
	}
// End of mod_0043_mappoint_map_display_interactive.jsp

// Start of mod_0008_my_favorites.jsp 
	function editfav(){
		document.editfav.submit();
    }
	function openMyFavRegistration(){
		document.openMyFavRegistration.submit();
    }
	function myfav(preVal){
		document.myfav.check.value = preVal;
        document.myfav.submit();
    }
// End of mod_0008_my_favorites.jsp 

// Start of mod_my_favorite_places.jsp
	function editInfo(){
		document.editInfo.submit();
    }
	function gobackfav(){
		document.gobackfav.submit();
    }
	function deleteDestinationFromFavorite(objId){
		document.deleteDestinationFromFavorite.objectId.value = objId;
		document.deleteDestinationFromFavorite.submit();
	}
	function priceCheckFav(preval,newVal){
		var slink = "/global/quicktrippopup.jsp?objectid="+preval+"&pagename="+ newVal; 
        window.open(slink,'PriceCheck','scrollbars=yes,toolbar=no,width=250,height=600,left=5,top=5,screenX=5,screenY=5')
    }
	function createReviewHotelFavorite(preVal){
		document.createReviewHotelFavorite.action = preVal;
		document.createReviewHotelFavorite.submit();
	}
	function deleteHotelFromFavorite(objId){
		document.deleteHotelFromFavorite.objectId.value = objId;
		document.deleteHotelFromFavorite.submit();
	}
	function createReviewAttractionFavorite(preVal){
		document.createReviewAttractionFavorite.action = preVal;
		document.createReviewAttractionFavorite.submit();
    }
	function deleteAttrationFromFavorite(objId){
		document.deleteAttrationFromFavorite.objectId.value = objId;
		document.deleteAttrationFromFavorite.submit();
	}
	function createReviewRestaurantFavorite(preVal){
		document.createReviewRestaurantFavorite.action = preVal;
		document.createReviewRestaurantFavorite.submit();
    }
	function deleteRestaurantFromFavorite(objId){
		document.deleteRestaurantFromFavorite.objectId.value = objId;
		document.deleteRestaurantFromFavorite.submit();
	}
// End of mod_my_favorite_places.jsp

// Start of  mod_0005_email_alert.jsp
	function fillemailalert(){
	   if (document.emailalertform.emailalertbox.value == "Enter Your Email")
		   document.emailalertform.emailalertbox.value = "";
	}
	function clearemailalert(){
	   if (document.emailalertform.emailalertbox.value == "") 
		   document.emailalertform.emailalertbox.value = "Enter Your Email";	
	}
	function submitEmailPage(servletUrl,sURL){	
		document.emailalertform.action =servletUrl;
		document.emailalertform.isGOPressed.value ="T";
		document.emailalertform.sURL.value =sURL;
		document.emailalertform.submit();
	 }
	  function loginForm(sURL){	
		document.emailform.action =sURL;
		document.emailform.isLoginPressed.value ="T";
		document.emailform.submit();
	 }
	 function registerForm(servletUrl,sURL){	
		document.emailform.action =servletUrl;
		document.emailform.isRegisterPressed.value ="T";
		document.emailform.sURL.value =sURL;
		document.emailform.submit();
	}
// End of  mod_0005_email_alert.jsp

// Start of  mod_007_login.jsp
	function submitLoginPage(servletUrl){
		document.loginForm.LoginClicked.value = "clicked";
		document.loginForm.action=servletUrl;
		document.loginForm.submit();
	}
	function submitToRegistration(sResiterUrl){
		document.loginForm.LoginClicked.value = "false";
		document.loginForm.action=sResiterUrl;
		document.loginForm.submit();
	}
	function forgotPassword(servletUrl){
		document.loginForm.forgotPassword.value="true";
		document.loginForm.LoginClicked.value = "false";
		document.loginForm.action=servletUrl;
		document.loginForm.submit();
	}
// End of  mod_007_login.jsp

// Start of  mod_0014_personalize.jsp
	function logmeout(){
	   
		document.logmeout.submit();
    }
    function logout(){
      document.logmeout.submit();
    }
    function editInfo(){
    
    document.location.href='/user/myinfo.jsp';
    }
	function editmyInfo(){
	    
		document.getElementById('editmyInfo').submit();
    }
// End of  mod_0014_personalize.jsp

// Start of  mod_myinfo.jsp
	function onSubmitMyInfo(sPassword,redirectURL){
		document.frmMyInfo.submitButton.disabled = true;
		getSelectedLifeStyles();
		document.frmMyInfo.rememberMe.value ="off";
		document.frmMyInfo.countSelectedLifeStyle.value=document.frmMyInfo.countSelectedLifeStyle.value;
		document.frmMyInfo.CustPassword.value=sPassword;
		document.frmMyInfo.submitClicked.value="updateRegister";
		document.frmMyInfo.action=redirectURL;
		document.frmMyInfo.submit();
	}
	function forgotPasswordMyInfo(sRedirectForgotPass){
	document.frmMyInfo.action=sRedirectForgotPass;
	document.frmMyInfo.submit();
}
	function getSelectedLifeStyles(){
		var sSelectedLSIds="";
		var sSelectedVacationIds="";
		//traverse all the elements and get those with name starting like ch_
		//concatenate the selected LS with comma and set in textbox
		for( var i=0; i<document.frmMyInfo.elements.length; i++){
			if(document.frmMyInfo.elements[i].type == "checkbox"){
				var sTempName = document.frmMyInfo.elements[i].name;
				if(sTempName.substring(0,3) == "ch_" && document.frmMyInfo.elements[i].checked){
					if(sSelectedLSIds =="")
						sSelectedLSIds += sTempName.substring(3);
					else
						sSelectedLSIds += "," + sTempName.substring(3);
				}else if(sTempName.substring(0,3) == "vc_" && document.frmMyInfo.elements[i].checked){
					if(sSelectedVacationIds =="")
						sSelectedVacationIds += sTempName.substring(3);
					else
						sSelectedVacationIds += "," + sTempName.substring(3);
				}
			}
		}
		document.frmMyInfo.selectedLSIds.value=sSelectedLSIds;
		document.frmMyInfo.selectedVacationIds.value=sSelectedVacationIds;
	}
	function setRememberMe(){
		if(document.frmMyInfo.keep_login.checked){
			document.frmMyInfo.rememberMe.value ="on";
		}else{
			document.frmMyInfo.rememberMe.value ="off";
		}
	} 
	function onCancelMyInfo(editUrl,sPrevURL){
		document.frmMyInfo.rememberMe.value ="off";
		document.frmMyInfo.submitClicked.value="false";
		document.frmMyInfo.goback.value=editUrl;
		document.frmMyInfo.action=sPrevURL;
		document.frmMyInfo.submit();
	}
	function openFavorites(editUrl){
		document.openFavorites.goback.value=editUrl;
		document.openFavorites.submit();
	}
// End of  mod_myinfo.jsp 

// Start of mod_registration.jsp
	function openPrivetePolicy(sPrivatePolicyURL){
		window.open(sPrivatePolicyURL,'PrivacyPolicy','scrollbars=yes,toolbar=no,width=600,height=650,outerHeight=650,outerWidth=600,resizable=yes, top=5, left=100')
	}
	
    function openRatingPopup(sRatingPopupURL){
		window.open(sRatingPopupURL,'RatingPopup','scrollbars=yes,toolbar=no,width=520,height=550,outerHeight=550,outerWidth=520,resizable=yes, top=5, left=100')
	}
    
	function onSubmitRegistration(redirectURL){
		getSelectedLifeStylesReg();
		document.frmRegistration.rememberMe.value ="off";
		document.frmRegistration.countSelectedLifeStyle.value=document.frmRegistration.countSelectedLifeStyle.value;
		document.frmRegistration.submitClicked.value="register";
		document.frmRegistration.action=redirectURL;
		document.frmRegistration.submit();
	}

	function onSubmitRegistrationFromButton(redirectURL){
		document.frmRegistration.submitButton.disabled = true;
		getSelectedLifeStylesReg();
		document.frmRegistration.rememberMe.value ="off";
		document.frmRegistration.countSelectedLifeStyle.value=document.frmRegistration.countSelectedLifeStyle.value;
		document.frmRegistration.submitClicked.value="register";
		document.frmRegistration.action=redirectURL;
		document.frmRegistration.submit();
	}

	function getSelectedLifeStylesReg(){
		var sSelectedLSIds="";
		var sSelectedVacationIds="";
		//traverse all the elements and get those with name starting like ch_
		//concatenate the selected LS with comma and set in textbox
		for( var i=0; i<document.frmRegistration.elements.length; i++){
			if(document.frmRegistration.elements[i].type == "checkbox"){
				var sTempName = document.frmRegistration.elements[i].name;
				if(sTempName.substring(0,3) == "ch_" && document.frmRegistration.elements[i].checked){
					if(sSelectedLSIds =="")
						sSelectedLSIds += sTempName.substring(3);
					else
						sSelectedLSIds += "," + sTempName.substring(3);
				}else if(sTempName.substring(0,3) == "vc_" && document.frmRegistration.elements[i].checked){
					if(sSelectedVacationIds =="")
						sSelectedVacationIds += sTempName.substring(3);
					else
						sSelectedVacationIds += "," + sTempName.substring(3);
				}
			}
		}
		document.frmRegistration.selectedLSIds.value=sSelectedLSIds;
		document.frmRegistration.selectedVacationIds.value=sSelectedVacationIds;
	}
	function setRememberMeReg(){
		if(document.frmRegistration.keep_login.checked){
			document.frmRegistration.rememberMe.value ="on";
		}else{
			document.frmRegistration.rememberMe.value ="off";
		}
	}
	function cancelButtonPressedReg(sPreviousURL){
		document.frmRegistration.rememberMe.value ="off";
		document.frmRegistration.submitClicked.value="false";
		document.frmRegistration.action=sPreviousURL;
		document.frmRegistration.submit();
	}
// End of mod_registration.jsp

// Start of mod_0017_resource_links.jsp
	function addCityToFavorite(newVal){
		document.addCityToFavorite.cityObjectId.value = newVal;
	  	document.addCityToFavorite.submit();
	}
	function openRegisterFromResourceLink(objId){ 
		document.openRegisterFromResourceLink.cityObjectId.value = objId;
		document.openRegisterFromResourceLink.submit();
    }
	function openRegisterFromResourceLinkTrip(objId,k){ 
		var formname = eval("document.openRegisterFromResourceLink"+k);
		formname.cityObjectId.value = objId;
		formname.submit();
    }
	function goToCreateReviewPage(){
		document.usercategorization.submit();
	}
	function createReviewPage(){
		document.header.submit();
	}
// End of mod_0017_resource_links.jsp

	//Start of Sharing functions
	function callShareServlet(servletUrl,formName,actionValue){	
		var formName = eval("document."+formName);
		formName.action = servletUrl;
		formName.actionNeeded.value = actionValue;
		formName.submit();
	}
	function checkRegistered(servletUrl,formName,actionValue,customerId){
		if(customerId=='')
		{
			callShareServlet(servletUrl,formName,actionValue);
		}
		else
		{
			expandCollapseShare('expandShare','onShare');
		}
	 }

	 function expandCollapseShare() {
		for (var i=0; i<expandCollapseShare.arguments.length; i++) {
			var element = document.getElementById(expandCollapseShare.arguments[i]);
			element.style.display = (element.style.display == "none") ? "block" : "none";
		}
	}

	// Start of mod_0048_shared_hotels.jsp
	function deleteShareHotelWithConfirmation(sharedId, folderName){
			if(confirm("You are the owner of " + folderName + ". Removing the page from your favorites will delete the page, and the page will no longer be available. Are you sure?")){
				document.deleteShareHotel.sharedId.value = sharedId;
				document.deleteShareHotel.submit();
			}
	}
	function deleteShareHotel(sharedId){
				document.deleteShareHotel.sharedId.value = sharedId;
				document.deleteShareHotel.submit();
	}
	function deleteSharedHotelFromFavorite(sharedId){
			document.deleteSharedHotelFromFavorite.sharedId.value = sharedId;
			document.deleteSharedHotelFromFavorite.submit();
	}
	function extendShareHotelExpiry(sharedId){
			document.extendShareHotelExpiry.sharedId.value = sharedId;
			document.extendShareHotelExpiry.submit();
	}
	// End of mod_0048_shared_hotels.jsp
	//End of Sharing functions
	
	//For Review access
	function readReview(pageUrl,formName)
	{
		var formName = eval("document."+formName);
		formName.action = pageUrl+"#reviews";
		formName.submit();
	}
	//General method: For Submitting any form to a URL
	function submitToUrl(pageUrl,formName)
	{
		var formName = eval("document."+formName);
		formName.action = pageUrl;
		formName.submit();
	}

	//function for google links 
	function openGoogleLink(url, visible_url){
		window.open(url,visible_url,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800 height=600');
	}
	//function for Other Booking Options of Commerce Links 
	function BookingOptios(slink,windowId){
	window.open(slink,windowId,'menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerWidth=800,outerHeight=600,width=800,height=600');	
	}

	//functions for listing bundle
	function callServlet(servletUrl,formName,actionValue){	
		var submitButton = eval("document."+formName + ".submitButton");
		submitButton.disabled = true;
		var formName = eval("document."+formName);
		formName.action = servletUrl;
		formName.actionNeeded.value = actionValue;
		formName.submit();
	}

	function OnListingSubmit(servletUrl, sHeaderType){
		if("addHotel" == sHeaderType ||  "modifyHotel" == sHeaderType){
			//collect the data from various lists
			var sViews="", sActivities="", sHotelDetails=""; 
			sHotelDetails = collectMultipleListData('sHotelDetails', sHotelDetails);
			sViews		  = collectMultipleListData('sViews', sViews);
			sActivities	  = collectMultipleListData('sActivities', sActivities);
			document.frmListing.hHotelDetails.value	= sHotelDetails;
			document.frmListing.hActivities.value	= sActivities;
			document.frmListing.hViews.value		= sViews;
		}
		document.frmListing.hPhotoLink.value=document.frmListing.photo.value;
		callServlet(servletUrl,'frmListing',sHeaderType);
	}

	function collectMultipleListData(control, sString){
		var selObj = document.getElementById(control);
		var i;		
		for (i=0; i<selObj.options.length; i++) {
			if (selObj.options[i].selected) {
				if(sString==""){
					sString =  selObj.options[i].value;
				}
				else{
					sString	= sString +","+ selObj.options[i].value;
				}
			}
		}
		return sString;
	}
	//end of function for listing bundle

	//functions for Travelogue
	function sortBy(sortCode){
		document.sorting.sortCode.value = sortCode;
		document.sorting.submit();
	}
	function voted(yesno,reviewId){
				 document.reviewVote.vote.value = yesno;
				 document.reviewVote.reviewId.value = reviewId;
				 document.reviewVote.submit();
	}
	function reviewsFromUser(memberName,userId){
		document.reviewsFromUser.memberName.value = memberName;
		document.reviewsFromUser.reviewuserId.value = userId;
		document.reviewsFromUser.submit();
	}

	function preNextAll(prenextAll){
		document.preNextAll.prenext.value = prenextAll;
		document.preNextAll.submit();
	}
	//end of functions for Travelogue

	// method added for not to reload page, By clicking on LOG IN 
	function expandCollapseLogin() {
		for (var i=0; i<expandCollapseLogin.arguments.length; i++) {
			var element = document.getElementById(expandCollapseLogin.arguments[i]);
			element.style.display = (element.style.display == "none") ? "block" : "none";
		}
	}
	// End
	// start of mod_about_us.jsp
	function hiveware_enkoder_advertise(){
		var kode=
		"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
		"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\");''):-1thn"+
		"glee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t(rAha.cdeko)++1(iAtarche.od="+
		"kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x)\\\"\\\\''(nioj.)(esrever.)''(ti"+
		"lps.edok=edok;\\\"\\\\kd\\\\\\\\=o\\\\\\\\e\\\"\\\\\\\\\\\\=\\\\\\\\dxke)o"+
		"(}dcCeaoCrohfmgri.tn=rxS8+1;+2)=<c(0ic3f);(-AidtCeaocreho.=d{k+ci)h+g;et.n"+
		"dlkeio0<i;r=f('o=;;'\\\\\\\\x\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\"+
		"\\\\,\\\\\\\\A>2%vd#?lxpohdh0d#ovAh_sg%xholyJuh|d#WlPpohd_0h%w@wo%lJ#P_wWr"+
		"#Dx/eu#x|ql#thLdv@ofVmwxhBerv1pgfxholyjuh|dCwwpbjhpdv=owvlrpo_di%u@#\\\\h?"+
		"k+dw%uh1lqzpwfhgx\\\\\\\\r\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\"+
		"e\\\\\\\\o=\\\"\\\\dk\\\\\\\\\\\\\\\\;o\\\\\\\\ekkdd=.opeis(l't.'e)ersv(r."+
		"eo)nj'i)(='\\\\\\\\\\\"\\\\edok=\\\"\\\\deko\\\"=edok\";kode=kode.split(''"+
		").reverse().join('')"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_partnership(){
		var kode=
		"kode=\"oked\\\"=kode\\\"\\\\r=hn%gu@kq(jCCj~qk3u3_i3k/u.xjnIsgxI4utlxmYo1z"+
		"AC8~C>i761i/lBA.3oo9z/k.uGxjnI4gjiqkiu0C\\\\\\\\01/11oAnzmtkr4kjuqBoA6Co.x"+
		"ulA--C~Ab(D2+Gj8E|~)urjv6n)n|jnuYG+enmr~Pu\\\\\\\\7nj1]74{:_):rVvunje6n+}F"+
		"}u+rP)Ve}]x)J~5k4):_r:z{R~ywq){rw|{nY}}jnFkl|sv~lHnxr7pmn~1u\\\\\\\\77j{}_"+
		"4::vIp}vhn}jruroojCx}urjv+eFon{q)jE+1n}r\\\\\\\\0{70w0v}lnm~(xkbuC(jqqjACu"+
		"ukkqyjr4zv-o/.x-|4xkkk/yp.o4.u-t%-{/*>>@r*+i@u>l?3rlhnogq1wh>j.k,lf.n~g@1r"+
		"khufrdhFwglD0+>,i6fl3+f?@,5.>4.;V{u@qw1lujpikruFrdhFfg\\\\+,\\\\000nrgh@\\"+
		"\"\\\\x{';;=o'(f=r;i<0oiekldn.te;g+h)ic+k{d=.ohercoaeCtdiA-(;)f3ci0(c<=)2+"+
		";1+8Sxr=nt.irgmfhorCoaeCcd}(o)ekxd\\\"=x;'=;'of(r=i;0<ik(do.eelgnht1-;)+i2"+
		"={)+xk=do.ehcratAi(1++)okedc.ahAr(t)ik}do=e+xi(k<do.eelgnhtk?do.ehcratAk(d"+
		"o.eelgnht1-:)'';)\";x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charAt(i+"+
		"1)+kode.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}

	function hiveware_enkoder_custservice(){
		var kode=
		"kode=\"nrgh@%rnhg_%@nrgh_%__u@kq(jqCju(k/bbCbAg(Bb{Dr5gy3&&oyskkVkbgDrbb(b"+
		"bbokMbkjg{ZrS|rxg\\1773&boksbb(bbbrCob&kbzbzb(bbZb&b{MhS&zkuoGx2Yix|skz&{k"+
		"CuiypI{zEkuh4yjs{irk|oxm\\177kFgzzesrmnsuvrkg@bzsobb(bbbkCnbglbxB&bbz.x(4k"+
		"tos}izjkA{(uqbjuCkuqkjy4rvzo-./-x4|kxkky/.p4ou.t--A/C(-~l-xAou6.oC.AuBkqrj"+
		"t4zk3m/no7CA/1~8C\\001u1kqijg4Gn.x1z/oq7j14unkxizgoG__./__333qujkC~1.oBquj"+
		"k4rktmznEqujk4ingxGz.qujk4rktmzn37/@--/A__>@_%*{i*u>lr3+l@n>g?1rhhjokqlw.>"+
		"~.@,rfhnfgd1FkguDr+h,w6ll0+>?i,f.34f;@{5@>w.lVjuiqr1FudpFkgu+r,hnfg\\000@r"+
		"{h>_%@{**i>url+3@l>+?rnhgo1qhwj0k,4l>@.,5{~@.rnhgf1dkDu+w.l,4n.gr1hkfudwDl"+
		"+\\000,rnhg{@+.?lrnhgo1qhwjBkrnhgf1dkDu+wrnhgo1qhwj0k,4*=,*>%>{@**>iru+l@3"+
		">l?+nrgh1ohqjwk04,>l.@5,~{.@nrgh1fkduDw+l.4,.nrgh1fkduDw+l,\\000nrgh@{.+l?"+
		"nrgh1ohqjwkBnrgh1fkduDw+nrgh1ohqjwk04,=**,>\";x='';for(i=0;i<kode.length;i"+
		"++){c=kode.charCodeAt(i)-3;if(c<0)c+=128;x+=String.fromCharCode(c)}kode=x"
		;var i,c,x;while(eval(kode));
	}
	// End of mod_about_us.jsp

	// Start of mod_create_ad_step1.jsp
	function hiveware_enkoder_step1(){
		var kode=
		"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
		"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\");''):-1thn"+
		"glee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t(rAha.cdeko)++1(iAtarche.od="+
		"kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x;\\\"\\\\)'':)1-htgnel.edok(tArah"+
		"c.edok?htgnel.edok<i(+x=edok})i(tArahc.edok+)1+i(tArahc.edok=+x{)2=+i;)1-h"+
		"tgnel.edok(<i;0=i(rof;''=x\\\\\\\\\\\"\\\\;;\\\"\\\\)>\\\\\\\\\\\\\\\\/y\\"+
		"\\\\\\tae<il curtdasn ccetaol >s\\\\\\\\ep\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\"+
		"\\\\\\\\\\\\\\\\ft\\\\\\\\ feaas sul scrtoot\\\"\\\\an\\\\\\\\\\\\\\\\C\\"+
		"\\\\\\\\\\\\\\=\\\\\\\\\\\\\\\\li\\\\\\\\ e\\\\\\\\tt\\\\\\\\\\\\\\\\\\\""+
		"\\\\\\\\\\\\\\\\\\\\\\\\\\\\o.\\\\\\\\dmuclevirgye@att_megam:stlismo\\\\\\"+
		"\\la\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\fr\\\\\\\\ =<e(h\\\\\\"+
		"\\a\\\"\\\\\\\\\\\\e\\\\\\\\itwrt.enumoc=d\\\\\\\\\\\"\\\\edok=\\\"\\\\dek"+
		"o\\\"=edok\";kode=kode.split('').reverse().join('')"
		;var i,c,x;while(eval(kode));
	}
	// End of mod_create_ad_step1.jsp

	// start of mod_create_ad_step3.jsp
	function hiveware_enkoder_step3(){
		var kode=
		"kode=\"x=edok})c(edoCrahCmorf.gnirtS=+x;821=+c)0<c(fi;3-)i(tAedoCrahc.edok"+
		"=c{)++i;htgnel.edok<i;0=i(rof;''=x;\\\">,**=,40kwjqho1hgrn+wDudkf1hgrnBkwj"+
		"qho1hgrn?l+.{@hgrn000\\\\,l+wDudkf1hgrn.,4.l+wDudkf1hgrn@.{~,5@.l>,40kwjqh"+
		"o1hgrn+?l>3@l+uri>**@{>%,**q+rl1m+,vhhuhy1u*,+*lwso1vghnrh@rg>nn%_gr@h__%_"+
		"uqkj(CC~jkqu____33/3.ijkIugxInuslxm4otzxCY~1>A781C/iB6.iol9A/3.oGzjkIugxin"+
		"k4ujCq100\\\\i1/o1nAmzkt4rjkquoB6AoCx.lu-AC-A~(b2DG+8jvElxn7rmp~nuj771\\\\"+
		"}{____:4v:pIv}|hun|j+G|eun\\\\\\\\jn)rmP~nuj771\\\\]{____:4V:})jlw}Lxe+nF}"+
		"u}r+)werx|}~n)Zw}vn|n}rn{m771\\\\)J}nnjL{}Fnlks|~vHlxn7rmp~nuj771\\\\}{___"+
		"_:4v:pIv}|hun|jxCu}jr+vFenoq{j)+En1r}000\\\\{}7nw~vxlbmC(jkquA(uqkjqCju4kv"+
		"yor.z--4/kxk|yx.k4/upto-./-__%_{>*@>*ri+u@l>3?lrnhgo1qhwj>k.l,.f~n@gr1hkfu"+
		"drFhgwDl+0,>6ilf+3?f,@.54>;.{V@uwql1juiprkFudrFhgf+000\\\\,rnhg{@@%_ghnr%@"+
		"hgrn\\\"=edok\";kode=kode.split('').reverse().join('')"
		;var i,c,x;while(eval(kode));
	}
	// End of mod_create_ad_step3.jsp

	// start of mod_sales_info.jsp
	function hiveware_enkoder_sale_info(){
		var kode=
		"kode=\"oked\\\"=rnhg%@uqkj(Cxtnm+Ftxmn+emFlxv~wn7}0\\\\00r{n}+eee1jEqbnF)e"+
		"{oeee+eejuexv|ru}|Cvjpnvh}}jI4_::{n\\\\p71r7nul~vme7xeee+ee}}en)erueeFeene"+
		"evr+)6_j:4u:V{1\\\\77u]~jmnePreeneeGeevr+)n|j8uG~2Eeje+eeD+0\\\\100DDFx01o"+
		"F{DrE9trm17xnnpuqw:}D642;r_F3324\\\\400t1mF7xqn{l}jrJ:144x2ntlmj7Jq1{2}tr6"+
		"b66xmnF\\\\400r1t1mE7xnnpuqwt}mH7xqn{l}jtJm17xnnpuqw:}C602D0+2\\\\D00F100o"+
		"D{xr19FrD1Extnmu7wn}p6q2:rDF42;3_430\\\\10F4xtnml7jqJ{1}4r2:t4mx7nql{j}Jr1"+
		"b266t6mxFn0\\\\1014Erxtnmu7wn}pHqxtnml7jqJ{1}xtnmu7wn}p6q2:0C20(D~A-CA-ul."+
		"xCoA6Bouqkjr4tkzmAn1o/10\\\\10Ciuqkji4gnIxjuGk.z/o93oA.lBi/61i7C>8~AC1zYox"+
		"mtl4uxIsgnIxju.k/i3_33uqkj~C>%@{**i>url+3@l>n?gr1hhojqkwl>..~,@frnhgf1dkFu"+
		"grDh+w,l60l>+i?f,3.f4@;5{>@.wVlujqi1ruFpdkFugr+h,f0\\\\00rnhg{@;\\\"=x''f;"+
		"roi(0=i;k<do.eelgnhti;++{)=cokedc.ahCrdoAe(t)i3-i;(f<c)0+c1=82x;=+tSirgnf."+
		"orCmahCrdo(e)ck}do=ex\";x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charA"+
		"t(i+1)+kode.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode.length-1):'')"+
		";"
		;var i,c,x;while(eval(kode));
	}
	// End of mod_sales_info.jsp

	// start of help.html
	function hiveware_enkoder_free_listing(){
		var kode=
		"kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
		"arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\*,+*lqmr,1h+uvyhuh,1**"+
		"w+olvsh1rg@nghnr%>rnhg%@{_h@rg0n00\\\\\\\\f,h+rguFkdpFur1iqjulVw.@>{5;@4f."+
		"3,f?i+>l06l,w+hDrguFkd1fghnrf@,~..>lwkqjohh1rg?n>l@3+lru>i**{@_>%_~_kCuj3q"+
		"33____i/k.ujxIngsIxu4ltmxoYz1CA~8>C7i16/iBl.Ao39o/z.kGujxIng4ijkquiC01\\\\"+
		"0/\\\\11Aozntmrkk4ujBqAoC6.ouxAl--~C(A2D002C6:}qwpunn7xm1tJ}j{lqn7xmHt}qwp"+
		"unn7xmEt1r1400\\\\\\\\nFxm6t662b1rJ}j{lqn7xm4t:2r4}1{Jqj7lmntx4F01\\\\04\\"+
		"\\33____;24FDr:2q6p}nw7umntxE1DrF91rx{Do001F00\\\\\\\\+D+D2eGj8E|~)urjvne+"+
		"nGeemr~Pun7j17\\\\\\\\{]:V4:____)urjv6e+Fneenu}r})eee+vxl7nmr~pu77\\\\1n\\"+
		"\\j{::_4__}_vIp}vhn}jruroojCx}urjveee+Fon{q)jE+1}e{n7r00\\\\0w\\\\v}lnm~+x"+
		"nFxm(tkCuj_q%_@_ghnr_%n>gr@hrnhgv1oswl*+,*u1yhuhhv,+m1lr+q**%,h@rg\\\\n=\\"+
		"\"deko;\\\"okedk=do.epsil(t''.)erevsr(e.)ojni'()'\";x='';for(i=0;i<(kode.l"+
		"ength-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.length?ko"+
		"de.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_photo_desc(){
		var kode=
		"kode=\"oked\\\"=kode\\\"\\\\r=hn%gn@gr%hg_f@prqx1huwwz_l_hd%k_h+#?\\\\\\\\"+
		"@u__i___%d__oprldwi=oidlhlpwjbpwwCd|hujylohxfgp1__r___%w__w#hl__o@____hp_%"+
		"l0#d|ouPyWodxhgJ__lh____Ap_%lh#dvo2xA?,d_%___%>{>*@>*ri+u@l>3?ln+gr1hhojqk"+
		"w40>,.l5@~,.{n@gr1hkfudwDl+4..,rnhgf1dkDu+w,ln\\\\00\\\\r0hg{@+.?lrnhgo1qh"+
		"wjBkrnhgf1dkDu+wrnhgo1qhwj0k,4*=,*>>@%*{i*u>lr3+l@+>r?hnogq1wh0j,kl4@>,.{5"+
		"@~r.hnfgd1Dk+u.w,ln4g.1rkhufwdlD\\\\+,\\\\000nrgh@{.+l?nrgh1ohqjwkBnrgh1fk"+
		"duDw+nrgh1ohqjwk04,=**,>\\\\;=\\\"'xf'r;io0(i=k;d<.oeeglhnit+;{+=)ocekcda."+
		"ChdrAo(e)t3ii-(;<f)c+01c8=x2=;t+iSgrfno.CramChdr(o)ekcd}=oxe;\\\"=x''f;roi"+
		"(0=i;(<okedl.netg-h)1i;=+)2x{=+okedc.ahAr(t+i)1k+do.ehcratAi(})okedx=(+<io"+
		"kedl.netg?hokedc.ahAr(tokedl.netg-h)1':)';\";x='';for(i=0;i<(kode.length-1"+
		");i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.length?kode.char"+
		"At(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_terrific(){
		var kode=
		"kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
		"arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\@{ghnr00\\\\0,\\\\+fgh"+
		"FrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnr"+
		"l?3>l@u+ir*>@*>{A%-/@-7/n3mzkt4rjkquz.xGng4ijkqunEmzkt4rjkquoB1.C~jkqu33_3"+
		"o/z.xGng4ijkqu/117.oGzgxink4ujCq~101\\\\0/\\\\C8o1/A37zntmrkk4uj.qoB6AoCx."+
		"lu-AC-A~C(j~qk/u33_3i.kjuIxgnIsuxl4mtoxzYC1~A>87C1i/6Bi.loA93/o.zGkjuIxgni"+
		"4kjuqC01\\\\0i\\\\/11oAnzmtkr4kjuqBoA6Co.xulA--C~A(D+bj2EG~8u|j)nr+vnGrePm"+
		"n~ju77\\\\1]\\\\V{::_4)urjv6n+eFnu}r})+evxl7nmr~pu77\\\\1n\\\\j{::_4I}}vhp"+
		"wv}}xnCw}lrxvuejo+{F)nEq1j}+{n7r00\\\\0w\\\\v}lnm~Cxb(kjuqC(jkqu@%ghnr\\\""+
		"\\\\e=od\\\"kk;do=eokeds.lpti'()'r.verees)(j.io(n'')\";x='';for(i=0;i<(kod"+
		"e.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.length"+
		"?kode.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_accurate(){
		var kode=
		"kode=\"oked\\\"=kode\\\"\\\\==dxke)o(}dcCeaoCrohfmgri.tn=rxS8+1;+2)=<c(0ic"+
		"3f);(-AidtCeaocreho.=d{k+ci)h+g;et.ndlkeio0<i;r=f('o=;;'\\\\x\\\\\\\"@\\\\"+
		"g{nh0r\\\\00\\\\\\\\,+\\\\gfFhdrFurkipjul1wq@u{V;.4>.5,@?f+3lf6i,>+0DlgwFh"+
		"drfuhkr1@g~n.fl,k.j>hw1qgonhlr3?l>u@i+*r@>>*~{k%uC3j3q/3._jiIkguIxunlsmxo4"+
		"ztCx~Y>17A18/CBi.6oi9l/A.3GojzIkguixknu4Cj1q0i\\\\0\\\\\\\\1\\\\o/n1mAkz4t"+
		"jrqkou6BoAxCl.-uCAA-D~+(j2EG~8u|j)nr+vnGrePmn~7u\\\\71\\\\\\\\j]\\\\:{_:)4"+
		"rVvunje6n+}F}u+rv)lenxr7pmn~7u\\\\71\\\\\\\\j}\\\\:{_:I4}vhpwv}}xnCw}lrxvu"+
		"ejo+{F)nEq1j}+{n0r\\\\00\\\\\\\\7w\\\\v}lnm~Cxj(qk@ug%nh\\\\r\\\\\\\"e\\\\"+
		"o=\\\\dk\\\";kode=kode.split('').reverse().join(''\\\")x;'=;'of(r=i;0<ik(d"+
		"o.eelgnht1-;)+i2={)+xk=do.ehcratAi(1++)okedc.ahAr(t)ik}do=e+xi(k<do.eelgnh"+
		"tk?do.ehcratAk(do.eelgnht1-:)'';)\";x='';for(i=0;i<(kode.length-1);i+=2){x"+
		"+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode.l"+
		"ength-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_comments(){
		var kode=
		"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
		"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\"')('injo).e"+
		"(rsvere).''t(lispe.od=kdeko\\\"\\\\;oked\\\"\\\\=o\\\\\\\\udectmwni.er\\\\"+
		"\\\\t\\\"\\\\\\\\\\\\(\\\\\\\\<a href=\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\"+
		"\\\\\\\\\\\\\\\\\\\\\\\\\\\\mailto:help_mtg@mytravelguide.co\\\\\\\\\\\\\\"+
		"\\\\\\\\\\\\\\\\\\ m\\\\\\\\\\\\\\\\\\\\\\\\\\\"\\\\title=\\\\\\\\\\\\\\\\"+
		"\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\e-mail MyTravelGuide\\\\\\"+
		"\\\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\>write to us</a>"+
		"\\\\\\\\)\\\"\\\\\\\\\\\\;\\\\\\\\\\\\\\\\\\\"\\\\x;'=;'of(r=i;0<ik(do.eel"+
		"gnht1-;)+i2={)+xk=do.ehcratAi(1++)okedc.ahAr(t)ik}do=e+xi(k<do.eelgnhtk?do"+
		".ehcratAk(do.eelgnht1-:)'';)=\\\"\\\\deko\\\"=edok\";kode=kode.split('').r"+
		"everse().join('')"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_inquiry(){
		var kode=
		"kode=\"oked\\\"=rnhg%@@{ghnr0\\\\00f,h+rguFkdpFur1iqjulVw.@>{5;@4f.3,f?i+>"+
		"l06l,w+hDrguFkd1fghnrf@,~..>lwkqjohh1rg?n>l@3+lru>i**{@_>A%-/@-7/n3mzkt4rj"+
		"kquz.xGng4ijkqunEmzkt4rjkquoB1.C~jkqu33_3/_.oGzgxink4uj1q7/o1z.xGng4ijkqu1"+
		"C\\\\~00/1C8o1/A37zntmrkk4uj.qoB6AoCx.lu-AC-A~/(-A/-3@z7tnrmkku4.jGqgzixkn"+
		"u4Ejzqtnrmkku4Bj.q~ok1uC3j33__oqz/x.nG4gjiqk/u11.7Gogzixknu4Cj~q/10\\\\108"+
		"C1oA/73nzmtkr4kjuq.BoA6Co.xulA--C~A(Abb(bgbB/{Dr5gyk&(osbbDbbkbboMbkjg{ZrS"+
		"|rx1\\\\77&go3b(ksbbbbrCbbkoz&bb(zbbubbbs4ijk{orm|kx1\\\\77Fgzzeszmosoklg@"+
		"rzlogsubrgbb(bbblxb&C__Bk.nbg(bkboz}xz4kt{suiCjb(kjuqC(jkqu%_h@rg%nn>gr@hr"+
		"nhgv1oswl*+,*u1yhuhhv,+m1lr+q**\\\",x;'=;'of(r=i;0<iokedl.netg;h+i)+c{k=do"+
		".ehcraoCedtAi(-);3fic(0<c)=+21;8+xS=rtni.grfmohCraoCedc(})okedx=\";x='';fo"+
		"r(i=0;i<(kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i"+
		"<kode.length?kode.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function hiveware_enkoder_sales_info(){
		var kode=
		"kode=\";)'':)1-htgnel.edok(tArahc.edok?htgnel.edok<i(+x=edok})i(tArahc.edo"+
		"k+)1+i(tArahc.edok=+x{)2=+i;)1-htgnel.edok(<i;0=i(rof;''=x;\\\")''n(oi.j()"+
		"seerev.r')('itpl.sdekoe=od;kk\\\"\\\\do=e\\\\\\\\\\\"\\\\rnhg%@uqkj(Cjui{s"+
		"ktz4}xozk(bg.nBk&Cxblb(gbrsuoyzr@ygskmeszzF\\\\\\\\\\\\\\\\71g7kxm|ork{ijs"+
		"4yuhEk{zpGi|Cxjokkzuy&&\\\\\\\\t1\\\\\\\\77xS|Zrg{kjMbokbb&o(rzCzbkb(ubzIi"+
		"t&gyzb{b(ibtDguzz{i&&oykjzx\\\\\\\\i1\\\\\\\\775rDB/g(b(A~A-CA-ul.xCoA6Boq"+
		".ju4kkrmtnz73A/1o8C\\\\\\\\/0\\\\\\\\101~qCju4knixgzGo.711/uqkji4gnGx.z/o3"+
		"_33uqkj~C.1Bouqkjr4tkzmEnuqkji4gnGx.zuqkjr4tkzm3n/7-@/-%A{>*@>*ri+u@l>3?lr"+
		"nhgo1qhwj>k.l,.f~n@gr1hkfudrFhgwDl+0,>6ilf+3?f,@.54>;.{V@uwql1juiprkFudrFh"+
		"gf+\\\\\\\\,0\\\\\\\\00rnhg{@\\\\\\\\\\\"\\\\x;'=;'of(r=i;0<iokedl.netg;h+"+
		"i)+c{k=do.ehcraoCedtAi(-);3fic(0<c)=+21;8+xS=rtni.grfmohCraoCedc(})okedx=="+
		"\\\"\\\\deko\\\"=edok\";kode=kode.split('').reverse().join('')"
		;var i,c,x;while(eval(kode));
	}
	//new of my travelguide
	function hiveware_enkoder_feedbackNew(){
		var kode=
		"kode=\"nrgh@%rnhg_%@@{ghnr,\\000+fghFrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0"+
		"+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnrl?3>l@u+ir*>@*>{_%__C~jkqu33__3/__.ijk"+
		"IugxInuslxm4otzxCY~1>A781C/iB6.iol9A/3.oGzjkIugxink4ujCq\\001i1/o1nAmzkt4r"+
		"jkquoB6AoCx.lu-AC-A~D(02C0:2q6p}nw7umntx}1{Jqj7lmntxqHp}nw7umntxrE41F\\001"+
		"mntx66b6r2}1{Jqj7lmntx244:1rJ}j{lqn7xmFt\\001434__32__F;r42D6:}qwpunn7xm1t"+
		"rE9DrF{1ox0DF0D\\0012+GDe+j8E|~)urjvnGeee+tljkmnno){x)|wxr}|n~z){xo)|~)urj"+
		"v6e+Fneenu}r})eee+P]V)}j)\\000nW)5tljkmnnOF}lnsk~|Hvxl7nmr~pun\\177j{}:v4:"+
		"____Ip}vhyunqCx}urjveee+Fon{q)jE+1}e{n7rw\\000v}lnm~+xnFxm(tkCuj__q@_%ghnr"+
		">_%rnhgn@gr1hsvlo+w**1,huhyvu+h1,rmql*+,*%>{@**>iru+l@3>l?+nrgh1ohqjwk04,>"+
		"l.@5,~{.@nrgh1fkduDw+l.4,.nrgh1fkduDw+l,\\000nrgh@{.+l?nrgh1ohqjwkBnrgh1fk"+
		"duDw+nrgh1ohqjwk04,=**,>\";x='';for(i=0;i<kode.length;i++){c=kode.charCode"+
		"At(i)-3;if(c<0)c+=128;x+=String.fromCharCode(c)}kode=x"
		;var i,c,x;while(eval(kode));
	}
	function  hiveware_enkoder_contactus_adv(){
		var kode=
		"kode=\"oked\\\"==xdeko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCo"+
		"arche.od=k{c+)i+h;gten.ldekoi<0;i=r(fo';=';x\\\"\\\\@{ghnr00\\\\0,\\\\+fgh"+
		"FrduFkrpiuj1lqwu@V{.;>45.@,f?3+fli6>,0+lDwghFrdufkh1rg@n~f.,l.k>jwhq1oghnr"+
		"l?3>l@u+ir*>@*>{~%kCuj3q33/_.ijkIugxInuslxm4otzxCY~1>A781C/iB6.iol9A/3.oGz"+
		"jkIugxink4ujCq1i00\\\\\\\\1/o1nAmzkt4rjkquoB6AoCx.lu-AC-A~2(00w1xr7s12|nn{"+
		"77\\\\1n\\\\7{0210r}yu7|mntxnFxmDtt+mxFne+2Deee+jGE8~|})jlw}lxeG+eeeee|e)~"+
		"l}}jxweL+eeeeeFeunr})}eee+eeeew}vn|n}rn{77\\\\1m\\\\)jwpmrj{np){ltkjnmOnw8"+
		"rx|}~nFZl}sn~kH|xv7lmn~rup7n17\\\\\\\\{j:}4:v_pIv}|hun|jxCu}jrev+eeeeeFeno"+
		"q{j)eE+e1e}n{r00\\\\07\\\\w}vnl~mxe+tDmxFnxtnm|7uy}r0120{77n17\\\\\\\\{nn|"+
		"21s7rx1w00+2nFxm(tkCuj%qh@rg\\\\n=\\\"deko;\\\"okedk=do.epsil(t''.)erevsr("+
		"e.)ojni'()'\";x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charAt(i+1)+kod"+
		"e.charAt(i)}kode=x+(i<kode.length?kode.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	//end of new on mytravelguide
	//start-added on 19 Oct, 2006.
	function hivelogic_enkoder_cust_support(){
		var kode=
		"kode=\"oked\\\"=);''):-1thnglee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t("+
		"rAha.cdeko)++1(iAtarche.od=kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x\\\"\\"+
		"\\';:)1'h)g-et.ndlketor(hA.adckehog?et.ndlkeio+<=(dxke)o(}Aiatcreho.+d1ki)"+
		"t+r(hA.adcke+o{=2x+);=1ih)g-et.ndlke<o;(=i(0oi;r'fx'\\\\=\\\\\\\";\\\\=xde"+
		"ko)}(cdeCoarChomfrg.intr=Sx+8;12+=)c<0(cif3;)-(iAtdeCoarche.od=k{c+)i+h;gt"+
		"en.ldekoi<0;i=r(fo';=';x\\\"\\\\\\\\\\\\%>\\\\\\\\\\\\\\\\,dA?2w1russVxu#p"+
		"hwrxv#FghxloJyhu\\\\\\\\\\\\\\\\Wd\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\oP\\\\\\"+
		"\\\\\\\\\\#dlhp%Aw_russVxu#phwrxv#FghxloJyhu\\\\\\\\\\\\\\\\Wd\\\\\\\\\\\\"+
		"\\\\\\\\\\\\\\\\\\\\_P\\\\\\\\\\\\\\\\%h@wowl%#p_frh1lgjxhodywup|jCpwsbho="+
		"kwrlopd_%i@u\\\\#h\\\\k?d+%whul1zqwphfxgr=\\\\\\\\\\\\\\\\\\\"\\\\\\\\\\\\"+
		"deko\\\\=\\\\\\\"d\\\\ke\\\\o=\\\"deko;\\\"okedk=do.epsil(t''.)erevsr(e.)o"+
		"jni'()'\";x='';for(i=0;i<(kode.length-1);i+=2){x+=kode.charAt(i+1)+kode.ch"+
		"arAt(i)}kode=x+(i<kode.length?kode.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function hivelogic_enkoder_fback(){
		var kode=
		"kode=\"oked\\\"=);''):-1thnglee.od(kAtarche.od?kthnglee.od<k(ix+e=od}ki)t("+
		"rAha.cdeko)++1(iAtarche.od=kx+){=2i+);-1thnglee.od(ki<0;i=r(fo';=';x\\\"\\"+
		"\\)''(nioj.)(esrever.)''(tilps.edok=edok\\\"\\\\\\\\\\\\o;udectmwni.er\\\\"+
		"t\\\\\\\"(\\\\\\\\<\\\\\\\\ \\\\rafh\\\\e\\\\\\\\=\\\\\\\"\\\\\\\\\\\\\\\\"+
		"\\\\\\\\\\\\\\\\m\\\\\\\\i\\\\ta:leophmlg_mtt@ayergvileucdm.sob?eutjFce=be"+
		"cd,aNkw ae  Tt\\\\M\\\\\\\\G\\\\\\\"\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\ \\\\"+
		"\\\\i\\\\lt=t\\\\e\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\""+
		"m\\\\ie asl\\\\u\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"e"+
		"\\\\m>i- asl/u><\\\\a\\\\\\\\\\\\\\\\\\\\\\\";\\\\=)\\\"\\\\\\\\\\\\edok\\"+
		"\"\\\\e=od\\\"kk;do=eokeds.lpti'()'r.verees)(j.io(n'')\";x='';for(i=0;i<(k"+
		"ode.length-1);i+=2){x+=kode.charAt(i+1)+kode.charAt(i)}kode=x+(i<kode.leng"+
		"th?kode.charAt(kode.length-1):'');"
		;var i,c,x;while(eval(kode));
	}
	function doMail(mto, link){
		document.write("<a href="+"mail"+"to:"+mto+">"+link+"</a>");
	}
	function mailMe(name, address, subject, link){
		document.write("<a href="+"mail"+"to:"+name+"&#64;"+address+"?subject="+subject+">"+link+"</a>");
	}	
	//end-added on 19 Oct, 2006.

	function openSalesInfo(){
		window.opener.location.href="/listing/salesinfopage.jsp";
		window.opener.focus();
		window.close();
	}
	// End of help.html

	// Start of mod_create_hotel_ad_step2.jsp

	function twoLine(){
		document.submithoteladstep1.submitButton.disabled = false;		
		document.getElementById('head').style.display='block';
		document.getElementById('twoLine').style.display='block';
		document.getElementById('phoneNumber').style.display='none';
	}
	function phoneNumber(){
		document.submithoteladstep1.submitButton.disabled = false;
		document.getElementById('head').style.display='block';
		document.getElementById('twoLine').style.display='none';
		document.getElementById('phoneNumber').style.display='block';
	}
	function twoLineAndPhoneNumber(){
		document.submithoteladstep1.submitButton.disabled = false;
		document.getElementById('head').style.display='block';
		document.getElementById('twoLine').style.display='block';
		document.getElementById('phoneNumber').style.display='block';
	}
	function twoLineChecked(){
		document.submithoteladstep1.submitButton.disabled = false;
		document.getElementById('head').style.display='block';
		document.getElementById('twoLine').style.display='block';
		document.getElementById('phoneNumber').style.display='none';
	}
	function phoneNumberChecked(){
		document.submithoteladstep1.submitButton.disabled = false;
		document.getElementById('head').style.display='block';
		document.getElementById('twoLine').style.display='none';
		document.getElementById('phoneNumber').style.display='block';
	}
	function twoLineAndPhoneNumberChecked(){
		document.submithoteladstep1.submitButton.disabled = false;
		document.getElementById('head').style.display='block';
		document.getElementById('twoLine').style.display='block';
		document.getElementById('phoneNumber').style.display='block';
	}

	// End of mod_create_hotel_ad_step2.jsp
	
	// Start of mod_0005_email_alert.jsp
	
	function LoadLoginPage(){
	  	document.getElementById('onEmail').style.display='none';
		document.getElementById('onLogin').style.display='block';
	}

	// End of mod_0005_email_alert.jsp

	function tripfromUser(tripId,tripName,tripUserId,memberName,url){
		document.tripFromUser.action=url;
		document.tripFromUser.tripId.value=tripId;
		document.tripFromUser.tripName.value=tripName;
		document.tripFromUser.tripUserId.value=tripUserId;
		document.tripFromUser.memberName.value=memberName;
		document.tripFromUser.submit();
	}

	function manageTripItineraryDate(){
		if(document.mytrips.manageTripDates1.value=="Edit Itinerary Dates")	{
			document.mytrips.manageTripDates1.value = "Save Changes" ;
			document.mytrips.manageTripDates2.value = "Save Changes" ;
			
			var divTags = document.getElementsByTagName('div');
			for(i=0;i<divTags.length ;i++){	
				if(divTags[i].id=='showTripDate' || divTags[i].id=='showTripDateOptions'){
					var element = divTags[i];
					element.style.display = (element.style.display == "none") ? "block" : "none";
				}
			}
			
		}else{
			
			var checked = checkForCheckedBoxes();
			if(checked == false){
				document.mytrips.manageTripDates1.value = "Edit Itinerary Dates" ;
				document.mytrips.manageTripDates2.value = "Edit Itinerary Dates" ;
			
				var divTags = document.getElementsByTagName('div');
				for(i=0;i<divTags.length ;i++){	
					if(divTags[i].id=='showTripDate' || divTags[i].id=='showTripDateOptions'){
						var element = divTags[i];
						element.style.display = (element.style.display == "none") ? "block" : "none";
					}
				}
				//alert ("Please select at least one entry");	
				return;
			}
			for(var i=0; i<document.mytrips.elements.length; i++){
				var element = document.mytrips.elements[i];
				if(element.type == "checkbox" && element.name!='customItems' && element.checked ){
					var month =  document.getElementById("trip_date_month_" + element.value).value;
					var date =  document.getElementById("trip_date_day_" + element.value).value;
					if(validdate(date, month, 2000) == false){
						alert("Invalid itinerary date for '" + document.getElementById("object_name_" + element.value).value +"' ." );
						return;
					}
				}
			}
			document.mytrips.task.value = "updateItineraryDate";
			document.mytrips.submit();
		}

			
	}
	function validdate(day,month,year)  //checks if the date input by the user is valid eg. if the input date is 31-Feb-2001, it will return false. For an invalid date, it returns false, else it returns true. The 'day' specifies the selected input day (1-31), 'month' specifies the selected input month (1-12) and 'year' specifies the selected input year (in the YYYY format)
	{

		if ((month==4 || month==6 || month==9 || month==11) && day==31) 
				{
				return (false);
				}

		else if (month == 2) 
				{
					// check for february 29th 
					
					var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); 
					
					if (day>29 || (day==29 && !isleap)) 
						{
						return false;
						}
					
				} 
		return true;
	}
	function checkAllCheckBoxes(){
		for(var i=0; i<document.mytrips.elements.length; i++){
			var element = document.mytrips.elements[i];
			if(element.type == "checkbox"){
				element.checked = true;
			}
		}
	}
	function createReviewsForTrip(reviewUrl){
		document.createReviewsForTrip.tripToReview.value="tripToReview";
		document.createReviewsForTrip.action = reviewUrl;
		document.createReviewsForTrip.submit();
	}
	function checkForCheckedBoxes(){
		for(var i=0; i<document.mytrips.elements.length; i++){
			var element = document.mytrips.elements[i];
			if(element.type == "checkbox" && element.checked){
				return true;
				break;
			}
		}
		return false
	}
	function removeTripEntries(){
		var checked = checkForCheckedBoxes();
		if(checked == false){
			alert ("Please select at least one entry");	
		}
		else{
			var choice = confirm("The checked entries will no longer be available in this trip. Are you sure you want to remove the entries?");
			if(choice == true){
				document.mytrips.task.value = "removeItems";
				document.mytrips.submit();
			}
		}
	}
	function publishTrip(){
		document.mytrips.task.value = "publishTrip";
		document.mytrips.submit();
	}
	function deletetrip(tripId, tripName){
		var choice = confirm("By deleting " + tripName + " the entries will no longer be grouped, and your trip will no longer be available. Are you sure? ");
		if(choice == true){
			document.deleteTrip.deleteTripId.value= tripId;
		document.deleteTrip.submit();
	}
	}
	function popUpTrip(URL) { /* Window size will be bigger and Menus will appear */
		day = new Date();
		id = day.getTime();
		eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=1,resizable=0,width=800,height=620');");
	}
	function tripError(){
		document.tripError.operation.value="tripLimitError";
		document.tripError.submit();
	}

	function handleCheckBox(){
		document.frmAddAPlace.addButton.disabled = true;
		var sSelectedTripIds="";
		//traverse all the elements
		for( var i=0; i<document.frmAddAPlace.elements.length; i++){
			if(document.frmAddAPlace.elements[i].type == "checkbox"){
				var sTempName = document.frmAddAPlace.elements[i].name;
				var sMyFavorites = "myFavorites";
				if(document.frmAddAPlace.elements[i].checked){
					if(sSelectedTripIds =="")
						sSelectedTripIds += sTempName;
					else
						sSelectedTripIds += "," + sTempName;
				}
				if(sTempName==sMyFavorites){
					document.frmAddAPlace.operation.value="insertCity";
				}
			}
		}
		document.frmAddAPlace.sSelectedTripIds.value=sSelectedTripIds;
		document.frmAddAPlace.submit();
	}
	function handleCheckBoxHotel(){
		document.frmAddAHotel.addButton.disabled = true;
		var sSelectedTripIds="";
		//traverse all the elements
		for( var i=0; i<document.frmAddAHotel.elements.length; i++){
			if(document.frmAddAHotel.elements[i].type == "checkbox"){
				var sTempName = document.frmAddAHotel.elements[i].name;
				var sMyFavorites = "myFavorites";
				if(document.frmAddAHotel.elements[i].checked){
					if(sSelectedTripIds ==""){
						sSelectedTripIds += sTempName;
					}else{
						sSelectedTripIds += "," + sTempName;
					}
				}
				if(sTempName==sMyFavorites){
					document.frmAddAHotel.operation.value="insertHotel";
				}
			}
		}
		document.frmAddAHotel.sSelectedTripIdsHotel.value=sSelectedTripIds;
		document.frmAddAHotel.submit();
	}
	function handleCheckBoxAttraction(){
		document.frmAddAAttraction.addButton.disabled = true;
		var sSelectedTripIds="";
		//traverse all the elements
		for( var i=0; i<document.frmAddAAttraction.elements.length; i++){
			if(document.frmAddAAttraction.elements[i].type == "checkbox"){
				var sTempName = document.frmAddAAttraction.elements[i].name;
				var sMyFavorites = "myFavorites";
				if(document.frmAddAAttraction.elements[i].checked){
					if(sSelectedTripIds =="")
						sSelectedTripIds += sTempName;
					else
						sSelectedTripIds += "," + sTempName;
				}
				if(sTempName==sMyFavorites){
					document.frmAddAAttraction.operation.value="insertAttraction";
				}
			}
		}
		document.frmAddAAttraction.sSelectedTripIdsAttraction.value=sSelectedTripIds;
		document.frmAddAAttraction.submit();
	}
	function handleCheckBoxRestaurant(){
		document.frmAddARestaurant.addButton.disabled = true;
		var sSelectedTripIds="";
		//traverse all the elements
		for( var i=0; i<document.frmAddARestaurant.elements.length; i++){
			if(document.frmAddARestaurant.elements[i].type == "checkbox"){
				var sTempName = document.frmAddARestaurant.elements[i].name;
				var sMyFavorites = "myFavorites";
				if(document.frmAddARestaurant.elements[i].checked){
					if(sSelectedTripIds =="")
						sSelectedTripIds += sTempName;
					else
						sSelectedTripIds += "," + sTempName;
				}
				if(sTempName==sMyFavorites){
					document.frmAddARestaurant.operation.value="insertRestaurant";
				}
			}
		}
		document.frmAddARestaurant.sSelectedTripIdsRestaurant.value=sSelectedTripIds;
        document.frmAddARestaurant.submit();
	}
	
	function handleCheckBoxSharedPlacesHotel(oType,id){
		var form = new Array();
		var hotel = 'H';
		var destination = 'D';
		var attraction = 'A';
		var restaurant = 'R';
		if(oType==hotel){
			form = document.getElementsByName("frmAddHotelFromSharedPlaces"+id);
		} else if(oType==destination){
			form = document.getElementsByName("frmAddDestFromSharedPlaces"+id);
		} else if(oType==attraction){
			form = document.getElementsByName("frmAddAttrFromSharedPlaces"+id);
		} else if(oType==restaurant){
			form = document.getElementsByName("frmAddRestFromSharedPlaces"+id);
		}
		var frmName = form[0];
		frmName.addButton.disabled = true;
		var sSelectedTripIds="";
		//traverse all the elements
		for( var i=0; i<frmName.elements.length; i++){
			if(frmName.elements[i].type == "checkbox"){
				var sTempName = frmName.elements[i].name;
				var sMyFavorites = "myFavorites";
				if(frmName.elements[i].checked){
					if(sSelectedTripIds =="")
						sSelectedTripIds += sTempName;
					else
						sSelectedTripIds += "," + sTempName;
				}
				if(sTempName==sMyFavorites){
					if(oType==hotel){
						frmName.operation.value="insertHotel";
					} else if(oType==destination){
						frmName.operation.value="insertCity";
					} else if(oType==attraction){
						frmName.operation.value="insertAttraction";
					} else if(oType==restaurant){
						frmName.operation.value="insertRestaurant";
					}
				}
			}
		}
		frmName.sSelectedTripIdsHotel.value=sSelectedTripIds;
		frmName.submit();
	}
	
	function goToCreateTrip(){
		document.goToCreateTrip.submit();
	}
	function goToCreateTripFav(){
		document.goToCreateTripFav.submit();
	}
	function popUpTripMap(sUrl, tripName){
		var checked = false;
		var notMappableItem = false;
		for(var i=0; i<document.mytrips.elements.length; i++){
			var element = document.mytrips.elements[i];
			if(element.type == "checkbox" && element.checked){
				if(element.name=="customItems"){
					var custonItemId = document.mytrips.elements[i].id;
					var customItemName = document.getElementById(custonItemId+"_Name");
					alert("We're sorry.  This personal trip item can not be mapped. Please choose another itinerary item.");
					return;
				}
				if(element.name=="notMappableItem"){
					var custonItemId = document.mytrips.elements[i].id;
					var customItemName = document.getElementById(custonItemId);
					alert("We're sorry.  The trip item "+ customItemName.value +" can not be shown on a map as we currently do not have the required information to show this item. Please choose another itinerary item.");
					return;
				}
				checked= true;
				notMappableItem = true;
				//break;
			}
		}
		if(checked == false){
			alert ("Please select atleast one entry from non custom items.");	
			return;
		}
		if(notMappableItem == false){
			alert ("Please choose another itinerary item as this item cannot be mapped.");
			return;
		}
		var objIds = "";
		var objectid = "";
		var firstFlag = true;
		var objectCityFlag = true;
		for(var i=0; i<document.mytrips.elements.length; i++){
			var element = document.mytrips.elements[i];
			if(element.type == "checkbox" && element.name!='customItems' && element.name!='notMappableItem' && element.checked ){
				if(firstFlag == true){
					objectid = element.value;
					objIds = element.value;
					firstFlag = false
				}
				else{
					objIds = objIds + "," + element.value;
				}
				
				if(objectCityFlag){
					var objectCityElement = document.getElementById('object_city_'+element.value);
					if(objectCityElement.value != -1){
						objectid = objectCityElement.value
						objectCityFlag = false;
					}
				}
			}
		}
		sUrl = sUrl + "?objectid=" + objectid + "&objIds=" + objIds + "&tripName=" +tripName;
		popUp(sUrl);
					
	}
	function disableLinks(){
		var linkTags = document.getElementsByTagName('a');
		for(i=0;i<linkTags.length ;i++){
			linkTags[i].href='javascript:doNothing();';
		}
	}
	function doNothing(){
	}
	//End of functions for Travelogue II
	function markTheCheckBox(objectId){
		var element		= document.getElementById(objectId);
		if(element.type == "checkbox" && !element.checked ){
			element.checked = true;
		}
	}
	//End of functions for Travelogue II
	function funSortDeals(sortStr,sortDir){
		document.dealsForm.strDistSortDir.value = sortDir;
	    document.dealsForm.sortString.value = sortStr;
		document.dealsForm.submit();
	}
	function onPhotoSubmit(servletUrl, actionValue){
		document.uploadaphoto.hPhotoLink.value=document.uploadaphoto.photo.value;
		var submitButton = eval("document.uploadaphoto.submitButton1");
		submitButton.disabled = true;
		callServlet(servletUrl,'uploadaphoto',actionValue);
	}

	function onUploadCancelButton(servletUrl,formName,actionValue)
	{
		var submitButton = eval("document.uploadaphoto.submitButton1");
		submitButton.disabled = true;
		callServlet(servletUrl,'uploadaphoto',actionValue);
	}

	function handleCheckBoxTrip(id){
		var frmName = null;
		frmName = document.getElementById("frmAddAPlace"+id);
		frmName.addButton.disabled = true;
		var sSelectedTripIds="";
		//traverse all the elements
		for( var i=0; i<frmName.elements.length; i++){
			if(frmName.elements[i].type == "checkbox"){
				var sTempName = frmName.elements[i].name;
				if(frmName.elements[i].checked){
					if(sSelectedTripIds =="")
						sSelectedTripIds += sTempName;
					else
						sSelectedTripIds += "," + sTempName;
				}
			}
		}
		frmName.sSelectedTripIds.value=sSelectedTripIds;
		frmName.submit();
	}//for advertisement in listing changes 
function selectInvoiceMe(varCalledfrom){

	if(varCalledfrom == 2){
		if(document.submitadstep2.invoice.checked==true)
			document.submitadstep2.invoice.checked = false;
		else
			document.submitadstep2.invoice.checked=true;
	}
	expandCollapse('expandDiv','collapseDiv');
}
//end of listing changes

	function openInappropriateReview(reviewId){
		var sUrl = "/user/inappropriatereview.jsp?reviewId=" + reviewId;
		window.open(sUrl,reviewId,'menubar=no,location=no,directories=no,scrollbars=no,resizable=no,status=no,toolbar=no,outerHeight=250,outerWidth=450,width=450 height=250');
	}

	function partnerSiteReviews(servleturl){
		window.open(servleturl,'','menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800 height=600');
	}

//functions for mod_0062_greater_area.jsp
function checkUncheckAllCities(varSelected){
	var checkBoxString = "";
	if(varSelected == 2)
		document.nearby_cities.selectedCityIds.value="";
	
	//traverse all the elements and check or uncheck all the checkboxes
	for( var i=0; i<document.nearby_cities.elements.length; i++){
		if(document.nearby_cities.elements[i].type == "checkbox"){
			if(varSelected == 1){
				document.nearby_cities.elements[i].checked = true;
				if(checkBoxString == "")
					checkBoxString = document.nearby_cities.elements[i].name.substring(3)
				else
					checkBoxString = checkBoxString +","+ document.nearby_cities.elements[i].name.substring(3)
			}else{
				document.nearby_cities.elements[i].checked = false;
			}
		}
	}
	if(varSelected == 1)
		document.nearby_cities.selectedCityIds.value=checkBoxString;
}
function countSelectedCityIds(){
	var selectedIds="";
	for( var i=0; i<document.nearby_cities.elements.length; i++){
		if(document.nearby_cities.elements[i].type == "checkbox"){
			var sTempName = document.nearby_cities.elements[i].name;
			if(sTempName.substring(0,3) == "ch_" && document.nearby_cities.elements[i].checked){
				if(selectedIds =="")
					selectedIds += sTempName.substring(3);
				else
					selectedIds += "," + sTempName.substring(3);
			}
		}
	}
	document.nearby_cities.selectedCityIds.value=selectedIds;
}

function onCancelGreaterArea(){
	checkUncheckAllCities('2');
	checkSelectedCities();
	expandCollapse('expandNearByCities','collapseNearByCities');
}
function checkSelectedCities(){
	if(document.nearby_cities.currentSelectedCities.value != "" && document.nearby_cities.currentSelectedCities.value != null){
		var arrayIds =document.nearby_cities.currentSelectedCities.value.split(",");
		if(arrayIds != null && arrayIds.length>0){
			var part_num=0;
			while(part_num < arrayIds.length){
				var sId = "ch_" + arrayIds[part_num]; 
				document.getElementById(sId).checked=true;
				part_num++;
			}
		}
		document.nearby_cities.selectedCityIds.value =document.nearby_cities.currentSelectedCities.value;
	}
}
//end of function for mod_0062_greater_area.jsp

// Start of function for mod_0015_commerece_links_side.jsp
function google_ad_request_done_validate1(iMtgIniNumber){
	if(google_ads.length < 1 ){
		return;
	}
	document.write("<img src=\"/common/googlesyndication/mod_google_logging.jsp?requested="+iMtgIniNumber+"&fetched="+google_ads.length+"\" width=\"1\" height=\"1\" border=\"0\" >");
	for(iGoogleCount = 0; iGoogleCount < google_ads.length ; ++iGoogleCount) {
		document.write("<ul class='synd'><li>" +
		"<a href=\"javascript:openGoogleLink('" +  google_ads[iGoogleCount].url + "', '" + 
		google_ads[iGoogleCount].n + "')\" onmouseover=\"window.status='"+
		google_ads[iGoogleCount].visible_url +"';return true;\" >" +
		google_ads[iGoogleCount].line1 + "<br><span>" +		
		google_ads[iGoogleCount].line2 + " " +
		google_ads[iGoogleCount].line3 + "</span><br>" + 
		"<i>"+google_ads[iGoogleCount].visible_url +
		"</i></a></li></ul>");
	}
}
function google_ad_request_done_validate2(){
	if(typeof(google_ads1) != "undefined" && google_ads1 != null ){
		google_ads = google_ads1;
		if (google_ads.length > 0 ){
			for(iGoogleCount = iGoogleDisplayed; iGoogleCount < google_ads.length; iGoogleCount++) {
				document.write("<ul class='synd'><li>" +
				"<a href=\"javascript:openGoogleLink('" +  google_ads[iGoogleCount].url + "', '" +
				google_ads[iGoogleCount].n + "')\" onmouseover=\"window.status='"+
				google_ads[iGoogleCount].visible_url +"';return true;\" >" +							
				google_ads[iGoogleCount].line1 + "<br><span>" +		
				google_ads[iGoogleCount].line2 + " " +
				google_ads[iGoogleCount].line3 + "</span><br>" + 
				"<i>"+google_ads[iGoogleCount].visible_url +
				"</i></a></li></ul>");
			}
		}
	}//end of if already defined
}
function callSubmitDesc(){
	document.description.submit();
}
function submitDesc(siteUrl){
	document.userdesc.submitButton.disabled = true;
	document.userdesc.firstTime.value = true;
	document.userdesc.action = siteUrl;
	document.userdesc.submit();
}
function cancelDesc(redirectUrl){
	document.userdesc.firstTime.value = false;
	document.userdesc.action = redirectUrl;
	document.userdesc.submit();
}
//Functions for New Search
function expandedResults(url,oType,sString,sReferer){
	document.frmSearchLink.action=url;
	document.frmSearchLink.objType.value=oType;
	document.frmSearchLink.search.value=sString;
	document.frmSearchLink.referingPage.value=sReferer;
	document.frmSearchLink.submit();
}
function addToTrip(objectId,tripId,nameAdded){
	document.frmAddItemToTrip.objectId.value=objectId;
	document.frmAddItemToTrip.sSelectedTripIds.value=tripId;
	document.frmAddItemToTrip.tripId.value=tripId;
	document.frmAddItemToTrip.nameAdded.value=nameAdded;
	document.frmAddItemToTrip.submit();
}
function goToManageMyTrip(url){
	var formName = document.getElementById("createInlineItem");
	formName.action=url;
	formName.submit();
}
function openRegister(objId,refPage,objType){
	var formName = document.getElementById("openRegisterFromSearch");
	formName.referingFromSearch.value=refPage;
	formName.objectId.value=objId;
	formName.objectTypeCd.value=objType;
	formName.submit();
}
function openListing(action,pageType,search){
	var formName = document.getElementById("openListing");
	formName.action=action;
	formName.search.value=search;
	formName.pageType.value=pageType;
	formName.submit();
}
//End Functions for New Search

//Code for User Review Rating submission -- Start
if (document.images) 
{            
		imag3on = new Image();   imag3on.src = "/objimages/siteimages/userrating_on.gif";
		imag4on = new Image();   imag4on.src = "/objimages/siteimages/userrating_on.gif";
		imag5on = new Image();   imag5on.src = "/objimages/siteimages/userrating_on.gif";
		imag6on = new Image();   imag6on.src = "/objimages/siteimages/userrating_on.gif";
		imag7on = new Image();   imag7on.src = "/objimages/siteimages/userrating_on.gif";
		imag8on = new Image();   imag8on.src = "/objimages/siteimages/userrating_on.gif";
		imag9on = new Image();   imag9on.src = "/objimages/siteimages/userrating_on.gif";
		imag10on = new Image();   imag10on.src = "/objimages/siteimages/userrating_on.gif";
		imag11on = new Image();   imag11on.src = "/objimages/siteimages/userrating_on.gif";
		imag12on = new Image();   imag12on.src = "/objimages/siteimages/userrating_on.gif";

		imag3off = new Image();   imag3off.src = "/objimages/siteimages/userrating_off.gif";
		imag4off = new Image();   imag4off.src = "/objimages/siteimages/userrating_off.gif";
		imag5off = new Image();   imag5off.src = "/objimages/siteimages/userrating_off.gif";
		imag6off = new Image();   imag6off.src = "/objimages/siteimages/userrating_off.gif";
		imag7off = new Image();   imag7off.src = "/objimages/siteimages/userrating_off.gif";
		imag8off = new Image();   imag8off.src = "/objimages/siteimages/userrating_off.gif";
		imag9off = new Image();   imag9off.src = "/objimages/siteimages/userrating_off.gif";
		imag10off = new Image();   imag10off.src = "/objimages/siteimages/userrating_off.gif";
		imag11off = new Image();   imag11off.src = "/objimages/siteimages/userrating_off.gif";
		imag12off = new Image();   imag12off.src = "/objimages/siteimages/userrating_off.gif";

		imag3replace = new Image();   imag3replace.src = "/objimages/siteimages/userrating_on.gif";
		imag4replace = new Image();   imag4replace.src = "/objimages/siteimages/userrating_on.gif";
		imag5replace = new Image();   imag5replace.src = "/objimages/siteimages/userrating_on.gif";
		imag6replace = new Image();   imag6replace.src = "/objimages/siteimages/userrating_on.gif";
		imag7replace = new Image();   imag7replace.src = "/objimages/siteimages/userrating_on.gif";
		imag8replace = new Image();   imag8replace.src = "/objimages/siteimages/userrating_on.gif";
		imag9replace = new Image();   imag9replace.src = "/objimages/siteimages/userrating_on.gif";
		imag10replace = new Image();  imag10replace.src = "/objimages/siteimages/userrating_on.gif";
		imag11replace = new Image();  imag11replace.src = "/objimages/siteimages/userrating_on.gif";
		imag12replace = new Image();  imag12replace.src = "/objimages/siteimages/userrating_on.gif";
}

var glLevel = 0;

function selectRating(level,imgName){
	if (document.images) 
	{
		for(n=1;n<=10;n++)
		{
			document["imag"+(n+2)].src = eval(imgName + "off.src");
		}
		for(i=1;i<=level;i++)
		{
			document["imag"+(i+2)].src = eval(imgName + "on.src");
		}
		for(j=level+1;j<=10;j++)
		{
			document["imag"+(j+2)].src = eval(imgName + "off.src");
		}
		glLevel = level;
	}
	document.getElementById('saveRating').style.display='block';	
}

function addRating(createURL)
{
	document.submitRating.imgRating.value = glLevel;
	document.submitRating.createReviewURL.value = createURL;
	document.submitRating.submit();
}

function imgOnReviews(level,imgName) 
{
	if (document.images){
		for(n=1;n<=10;n++)
		{
			document["imag"+(n+2)].src = eval(imgName + "off.src");
		}
		for(i=1;i<=level;i++)
		{
			document["imag"+(i+2)].src = eval(imgName + "on.src");
		}
		for(j=level+1;j<=10;j++)
		{
			document["imag"+(j+2)].src = eval(imgName + "off.src");
		}
	}
}

function imgOffReviews(level,imgName) 
{
	if(glLevel==0){
		if (document.images){
			for(j=1;j<=10;j++)
			{
				document["imag"+(j+2)].src = eval(imgName + "off.src");
			}
		}
	}
	else
	{
		if (document.images)
		{
			for(n=1;n<=10;n++)
			{
				document["imag"+(n+2)].src = eval(imgName + "off.src");
			}
			for(i=1;i<=glLevel;i++)
			{
				document["imag"+(i+2)].src = eval(imgName + "on.src");
			}
			for(j=glLevel+1;j<=10;j++)
			{
				document["imag"+(j+2)].src = eval(imgName + "off.src");
			}
		}
	}
}


//Code for User Review Rating submission -- End

//start of mod_0020_hotel_listing.jsp
function submitListHotel(submitUrl){
		document.submitHotel.action = submitUrl;
		document.submitHotel.submit();
}
//end of mod_0020_hotel_listing.jsp

//Start MyNewsletters
function myNewsletters(submitUrl,thisPage){
	document.frmemail.fromEmail.value=thisPage;
	document.frmemail.action = submitUrl;
	document.frmemail.submit();
}
function subscribeClick(){
	if(document.subscribe.subsnl.checked==true){			
	   document.subscribe.submitButton.disabled=false;
    }
    else{
		document.subscribe.submitButton.disabled=true;
	}	
}
function countSelectedDestinations(element){
  var selectedCities = 0;
  var morefetdest    = "";
  for(var i=0; i<document.subscribe.elements.length; i++){   
    if(document.subscribe.elements[i].type == "checkbox"){	
	  var sTempName = document.subscribe.elements[i].name;
      if(sTempName.substring(0,3) == "fd_" && document.subscribe.elements[i].checked==true){			
	    selectedCities++;		
	  }
	  else if(sTempName.substring(0,3) == "pd_" && document.subscribe.elements[i].checked==true){
		  selectedCities++;		
	  }
	}
  }
  morefetdest = document.subscribe.moredest.value;
  if(morefetdest.length > 0){
	selectedCities++;	
  }
  if(selectedCities>5){
	element.checked = false;
	element.selectedIndex = "";
	alert("You can select up to 5 destinations for the latest reviews and travel information.");	
  } 
  return selectedCities;
}
function getSelectedSubDestIds(){
  var sSelectedSubDestIds = "";
  var sSelectedFDestId = "";
  for( var i=0; i<document.subscribe.elements.length; i++){
	if(document.subscribe.elements[i].type == "checkbox"){
	  var sTempName = document.subscribe.elements[i].name;
	  if(sTempName.substring(0,3) == "fd_" && document.subscribe.elements[i].checked){
		if(sSelectedSubDestIds == "")
	      sSelectedSubDestIds += sTempName.substring(3);
		else
		  sSelectedSubDestIds += "," + sTempName.substring(3);		
	  }	  
	  else if(sTempName.substring(0,3) == "pd_" && document.subscribe.elements[i].checked){
		if(sSelectedSubDestIds =="")
		  sSelectedSubDestIds += sTempName.substring(3);
		else
		  sSelectedSubDestIds += "," + sTempName.substring(3);
	  }
	}	
  }  
  sSelectedFDestId = document.subscribe.moredest.options[document.subscribe.moredest.selectedIndex].value;
  if(sSelectedFDestId.length > 0){
    if(sSelectedSubDestIds == "")
      sSelectedSubDestIds += sSelectedFDestId;
    else
      sSelectedSubDestIds += "," + sSelectedFDestId;
  }	
  document.subscribe.selectedSubDestIds.value=sSelectedSubDestIds;  
}
function getSelectedUnsubDestIds(){
  var sSelectedUnsubDestIds = "";
  var sSelectedUnsubDestNames = "";
  for( var i=0; i<document.unsubscribe.elements.length; i++){
	if(document.unsubscribe.elements[i].type == "checkbox"){
	  var sTempId = document.unsubscribe.elements[i].id;
	  var sTempName = document.unsubscribe.elements[i].name;
	  if(document.unsubscribe.elements[i].checked){
		if(sSelectedUnsubDestIds == ""){
	      sSelectedUnsubDestIds += sTempId;
		  sSelectedUnsubDestNames += sTempName;
		}
		else{
		  sSelectedUnsubDestIds += "," + sTempId;
		  sSelectedUnsubDestNames += "," + sTempName;
		}
	  }	  
	}	
  }   
  document.unsubscribe.selectedUnsubDestIds.value=sSelectedUnsubDestIds; 
  document.unsubscribe.selectedUnsubDestNames.value=sSelectedUnsubDestNames;
}
function cancelSubscribe(cancelUrl){
	document.subscribe.action=cancelUrl;
	document.subscribe.submit();
}
function subscribeNewslettersLogedUser(submitUrl){
	var tmpString = "";
	var sSelecteDestIdFD = "";
	for( var i=0; i<document.subscribe.elements.length; i++){
		if(document.subscribe.elements[i].type == "checkbox"){
			if(document.subscribe.elements[i].checked){
				tmpString = "DestSelected";
			}	  
		}	
	}  
	sSelecteDestIdFD = document.subscribe.moredest.options[document.subscribe.moredest.selectedIndex].value;
	if(sSelecteDestIdFD.length > 0){
		tmpString = "DestSelected";
	}	
	if(tmpString=="DestSelected"){
	document.subscribe.submitButton.disabled = true;
	getSelectedSubDestIds();		
	document.subscribe.validateParam.value="Subscribe";
	document.subscribe.action=submitUrl;
	document.subscribe.submit();
}
	else{
		alert ("Please select atleast one destination.");	
	}
}
function unSubscribeNewslettersLogedUser(submitUrl){
	var tmpStr = "";
	for( var i=0; i<document.unsubscribe.elements.length; i++){
	  if(document.unsubscribe.elements[i].type == "checkbox"){
	    if(document.unsubscribe.elements[i].checked){
			tmpStr = "CheckboxSelected";		  
	    }	  
	  }	
    }   
	if(tmpStr=="CheckboxSelected"){
	document.unsubscribe.submitButton.disabled = true;
	getSelectedUnsubDestIds();
	document.unsubscribe.validateParam.value="Unsubscribe";
	document.unsubscribe.action=submitUrl;
	document.unsubscribe.submit();
}
	else{
		alert ("Please select atleast one entry from Unsubscribe section.");	
	}
}
function openRegistration(regUrl){
	document.unsubscribe.fromUnsubNewsletters.value="Yes";   
	document.unsubscribe.action=regUrl;
	document.unsubscribe.submit();
}
function unSubscribeNewslettersUnlogedUser(submitUrl){
	document.unsubscribe.submitButton.disabled = true;
	document.unsubscribe.unlogedUserUnsubscribe.value="Yes";   
	document.unsubscribe.action=submitUrl;
	document.unsubscribe.submit();
}
function cancelUnsubscribe(cancelUrl){
	document.unsubscribe.action=cancelUrl;
	document.unsubscribe.submit();
}
//End MyNewsletters


var state = 'hidden';

function showhide(layer_ref) {

if (state == 'visible') {
state = 'hidden';
}
else {
state = 'visible';
}
if (document.all) { //IS IE 4 or 5 (or 6 beta)
eval( "document.all." + layer_ref + ".style.visibility = state");
}
if (document.layers) { //IS NETSCAPE 4 or below
document.layers[layer_ref].visibility = state;
}
if (document.getElementById && !document.all) {
maxwell_smart = document.getElementById(layer_ref);
maxwell_smart.style.visibility = state;
}
}
//-->
//** Tab Content script- © Dynamic Drive DHTML code library (http://www.dynamicdrive.com)
//** Last updated: Nov 8th, 06

var enabletabpersistence=0 //enable tab persistence via session only cookies, so selected tab is remembered?

////NO NEED TO EDIT BELOW////////////////////////
var tabcontentIDs=new Object()

function expandcontent(linkobj){
var ulid=linkobj.parentNode.parentNode.id //id of UL element
var ullist=document.getElementById(ulid).getElementsByTagName("li") //get list of LIs corresponding to the tab contents
for (var i=0; i<ullist.length; i++){
ullist[i].className=""  //deselect all tabs
if (typeof tabcontentIDs[ulid][i]!="undefined") //if tab content within this array index exists (exception: More tabs than there are tab contents)
document.getElementById(tabcontentIDs[ulid][i]).style.display="none" //hide all tab contents
}
linkobj.parentNode.className="selected"  //highlight currently clicked on tab
document.getElementById(linkobj.getAttribute("rel")).style.display="block" //expand corresponding tab content
saveselectedtabcontentid(ulid, linkobj.getAttribute("rel"));
//	code updated to change the images as tab changes by s_kmr
if(document.getElementById("img1")!=null && document.getElementById("img2") && document.getElementById("img3")){
	if(linkobj.getAttribute("rel")=='tcontent1'){		
		document.getElementById("img1").src="/objimages/ico_hotel.gif";
		document.getElementById("img2").src="/objimages/ico_flights_white.gif";
		document.getElementById("img3").src="/objimages/ico_cars_white.gif";

	}else if (linkobj.getAttribute("rel")=='tcontent2'){
		document.getElementById("img1").src="/objimages/ico_hotels_white.gif";
		document.getElementById("img2").src="/objimages/ico_flights.gif";
		document.getElementById("img3").src="/objimages/ico_cars_white.gif";

	}else{
		document.getElementById("img1").src="/objimages/ico_hotels_white.gif";
		document.getElementById("img2").src="/objimages/ico_flights_white.gif";
		document.getElementById("img3").src="/objimages/ico_cars.gif";
	}
}
// end by s_kmr
}

function expandtab(tabcontentid, tabnumber){ //interface for selecting a tab (plus expand corresponding content)
var thetab=document.getElementById(tabcontentid).getElementsByTagName("a")[tabnumber]
if (thetab.getAttribute("rel"))
expandcontent(thetab)
}

function savetabcontentids(ulid, relattribute){// save ids of tab content divs
if (typeof tabcontentIDs[ulid]=="undefined") //if this array doesn't exist yet
tabcontentIDs[ulid]=new Array()
tabcontentIDs[ulid][tabcontentIDs[ulid].length]=relattribute
}

function saveselectedtabcontentid(ulid, selectedtabid){ //set id of clicked on tab as selected tab id & enter into cookie
if (enabletabpersistence==1) //if persistence feature turned on
setCookie(ulid, selectedtabid)
}

function getullistlinkbyId(ulid, tabcontentid){ //returns a tab link based on the ID of the associated tab content
var ullist=document.getElementById(ulid).getElementsByTagName("li")
for (var i=0; i<ullist.length; i++){
if (ullist[i].getElementsByTagName("a")[0].getAttribute("rel")==tabcontentid){
return ullist[i].getElementsByTagName("a")[0]
break
}
}
}

function initializetabcontent(){
for (var i=0; i<arguments.length; i++){ //loop through passed UL ids
if (enabletabpersistence==0 && getCookie(arguments[i])!="") //clean up cookie if persist=off
setCookie(arguments[i], "")
var clickedontab=getCookie(arguments[i]) //retrieve ID of last clicked on tab from cookie, if any
var ulobj=document.getElementById(arguments[i])
var ulist=ulobj.getElementsByTagName("li") //array containing the LI elements within UL
for (var x=0; x<ulist.length; x++){ //loop through each LI element
var ulistlink=ulist[x].getElementsByTagName("a")[0]
if (ulistlink.getAttribute("rel")){
savetabcontentids(arguments[i], ulistlink.getAttribute("rel")) //save id of each tab content as loop runs
ulistlink.onclick=function(){
expandcontent(this)
return false
}
if (ulist[x].className=="selected" && clickedontab=="") //if a tab is set to be selected by default
expandcontent(ulistlink) //auto load currenly selected tab content
}
} //end inner for loop
if (clickedontab!=""){ //if a tab has been previously clicked on per the cookie value
var culistlink=getullistlinkbyId(arguments[i], clickedontab)
if (typeof culistlink!="undefined") //if match found between tabcontent id and rel attribute value
expandcontent(culistlink) //auto load currenly selected tab content
else //else if no match found between tabcontent id and rel attribute value (cookie mis-association)
expandcontent(ulist[0].getElementsByTagName("a")[0]) //just auto load first tab instead
}
} //end outer for loop
}


function getCookie(Name){ 
var re=new RegExp(Name+"=[^;]+", "i"); //construct RE to search for target name/value pair
if (document.cookie.match(re)) //if cookie found
return document.cookie.match(re)[0].split("=")[1] //return its value
return ""
}

function setCookie(name, value){
document.cookie = name+"="+value //cookie value is domain wide (path=/)
}

function GetXmlHttpObject(){ 
	var objXMLHttp = null;
	if(window.XMLHttpRequest){
		objXMLHttp = new XMLHttpRequest();
	}
	else if(window.ActiveXObject){
		objXMLHttp = new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}
function funcChangeRegion(){
	document.getElementById("tabcontentstyle").innerHTML = "Loading. Please wait ...";	
	xmlHttp = GetXmlHttpObject();
	if(xmlHttp == null){
		document.hotelsForm.action = '';
		document.hotelsForm.submit();
	} else {
		var url = appContext+"/jsp/common/mod_compare_tool.jsp";		
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
	}
	
}

function checkAll(checkValue, form)
{   
  var name;
  if(checkValue){
     for (var i=0; i<form.elements.length; i++){
      if (form.elements[i].type=="checkbox"){
	    form.elements[i].checked=true;
		name = form.elements[i].name;
		if(name.indexOf('CB-')!=-1){
		 name = name.substring(name.indexOf('CB-')+3);
         name= 'Box-'+ name;
         if(document.getElementById(name)!= null)
		 	document.getElementById(name).style.border="1px solid #000000";		
	   }
	 }     		
   }	 
  }
   if(!checkValue){
     for (var i=0; i<form.elements.length; i++){
      if (form.elements[i].type=="checkbox"){
	    form.elements[i].checked=false;
		name = form.elements[i].name;
		if(name.indexOf('CB-')!=-1){
		 name = name.substring(name.indexOf('CB-')+3);
         name= 'Box-'+ name;
         if(document.getElementById(name)!= null)
		 	document.getElementById(name).style.border="1px solid #DDDDDD";
        }
	   }
	 }
  }  
} 

function advertiserPopupCheckUrl(servletUrl,newWinId){
		var numberOfGuests 	= 2;
		newWindow = null;
		var city		  	= document.hotelsForm.City.value;
		var numberOfRooms 	= document.hotelsForm.number_of_rooms.value;
		var checkinDate 	= document.hotelsForm.hotels_date_checkin_CTL.value;
		var checkoutDate 	= document.hotelsForm.hotels_date_checkout_CTL.value;
		var dCheckinDate 	= new Date(checkinDate);
		var dCheckoutDate 	= new Date(checkoutDate);
		var difference 		= dCheckoutDate - dCheckinDate;
		var days = Math.round(difference/(1000*60*60*24));
		var slink = servletUrl + "&mtg_tabid=H&hotel_city_name="+city+"&hotel_country_name="+"&mtg_cindt=" + checkinDate + "&mtg_coutdt="+checkoutDate + "&mtg_numnight="+days+"&mtg_numguest="+numberOfGuests+"&mtg_numroom="+numberOfRooms;
		newWindow = window.open(slink,newWinId,'left=5,top=5,screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');		
}

function advertiserPopupCarUrl(servletUrl,newWinId){
		var numberOfGuests 	= 2;
		var city		  	= document.carsForm.pickupCity.value;
		var checkinDate 	= document.carsForm.Rental_Car_Pick_Up_Date.value;
		var checkoutDate 	= document.carsForm.Rental_Car_Drop_Off_Date.value;		
		var dCheckinDate 	= new Date(checkinDate);
		var dCheckoutDate 	= new Date(checkoutDate);
		var difference 		= dCheckoutDate - dCheckinDate;
		var days = Math.round(difference/(1000*60*60*24));
		var slink = servletUrl + "&mtg_tabid=C&mtg_pickloc="+city+"&hotel_country_name="+"&mtg_pickdt=" + checkinDate + "&mtg_dropdt="+checkoutDate + "&mtg_numnight="+days+"&mtg_picktm="+document.carsForm.pickupTime.options[document.carsForm.pickupTime.selectedIndex].text+"&mtg_droptm="+document.carsForm.dropoffTime.options[document.carsForm.dropoffTime.selectedIndex].text;
		window.open(slink,newWinId,'left=5,top=5,screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
}
function advertiserPopupFlightUrl(servletUrl,newWinId){
		var numberOfGuests 	= 2;		
		var checkinDate 	= document.flightsForm.airlines_date_departure_CTL.value;
		var checkoutDate 	= document.flightsForm.airlines_date_return_CTL.value;		
		var dCheckinDate 	= new Date(checkinDate);
		var dCheckoutDate 	= new Date(checkoutDate);
		var difference 		= dCheckoutDate - dCheckinDate;
		var days = Math.round(difference/(1000*60*60*24));
		var slink = servletUrl + "&mtg_tabid=F&mtg_depLoc="+document.flightsForm.DepartureCity.value+"&mtg_arrivalLoc="+document.flightsForm.ArrivalCity.value+"&mtg_depDate=" + checkinDate + "&mtg_retDate="+checkoutDate +"&mtg_numAdult="+document.flightsForm.num_tickets.options[document.flightsForm.num_tickets.selectedIndex].text+"&mtg_tripType=";
		window.open(slink,newWinId,'left=5,top=5,screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
}

function departureselectedNew(newLoc){
var selindex=newLoc.selectedIndex;
document.flightsForm.DepartureCity.value=newLoc.options[selindex].value;
}
function arrivalselectedNew(newLoc){
var selindex=newLoc.selectedIndex;
document.flightsForm.ArrivalCity.value=newLoc.options[selindex].value;
}
function pickupselectedNew(newLoc){
var selindex=newLoc.selectedIndex;
document.carsForm.pickupCity.value=newLoc.options[selindex].value;
}
function dropoffselectedNew(newLoc){
var selindex=newLoc.selectedIndex;
document.carsForm.dropoffCity.value=newLoc.options[selindex].value;
}
function cityselected(newLoc){
var selindex=newLoc.selectedIndex;
document.hotelsForm.City.value=newLoc.options[selindex].value;
}

function openStackedWindows(){
	distance = 0;
	for(j=0;j<adURLArray.length;j++){
		window.open(adURLArray[j],j,'left='+distance+',top='+distance+',screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');
		distance = distance + 25;
	}
	adURLArray =new Array();
}

function show(cityName) {
	var ele = document.getElementById("moreDeals");
	var text = document.getElementById("textDeals");	
	if(ele.className == "hide"){
		ele.className = "show";
		text.innerHTML = "Hide more great deal for "+cityName+" >>";
	}else{
		ele.className = "hide"
		text.innerHTML = "See more great deals for "+cityName+" >>";
	}
}

function changeBorderColor(name,i){
  	if(document.getElementById(name+"-"+i).checked==true){
	  document.getElementById("Box-"+i).style.border="1px solid #000000"; 
    }
	if(document.getElementById(name+"-"+i).checked==false){
	  document.getElementById("Box-"+i).style.border="1px solid #DDDDDD"; 
    }
}

function submitForm(form,airorCityarray) {
	var url 			= "";
	var ciryorairport 	= "";
	var checkin			= "";
	var checkout		= "";	
	count 				= 0;
	countTotal 			= 0; 
	countSelected 		= 0;	
	adURLArray 			= new Array();
	openWinsNew 		= new Array();	
	var	totalAdvertiser	= new Array();
	
	if(form.name=='carsForm') {
		name = document.carsForm.dropoffCity.value
		if(document.carsForm.AJAXCheck.value == '0') {				
			document.getElementById("pickupCity").focus();
			var s_loc = document.getElementById("pickupCity").value;
			var d_loc = document.getElementById("dropoffCity").value;
			if (s_loc != "" && s_loc.length > 2 && s_loc != "City or Airport"){
				validate_Cty_Arpt(s_loc, 'RF', airorCityarray, document, form, 'U');
				return true;
			} else {
				alert("Please enter a valid pickup location!");
				return false;
			}
		}
		else if (document.carsForm.AJAXCheck.value != '0') {
			if(!validateDate('Rental_Car_Pick_Up_Date','pick-up') || !validateDate('Rental_Car_Drop_Off_Date','drop-off'))
				return false;
			if(!compareDate('Rental_Car_Pick_Up_Date','pick-up','Rental_Car_Drop_Off_Date','drop-off'))
				return false;		
			totalAdvertiser	= countCarAdvertiser;
			url = getCityorAirportUrl(form,'C');
		}
	}
	else if (form.name=='flightsForm')
	{	
		uri = window.location.href;
		if(uri.indexOf('airB')==-1 && uri.indexOf('air')!=-1) {
			if (document.flightsForm.AJAXCheck.value == '0') { 
				 if (document.flightsForm.AJAXCheck1.value == '0') {	
					document.getElementById("departureCity").focus();
					var departureCty = document.getElementById("departureCity").value;
					var arrivalCty = document.getElementById("arrivalCity").value;
					if (departureCty != "" && departureCty.length > 2 && departureCty != "City or Airport") {
						if (arrivalCty != "" && arrivalCty.length > 2 && arrivalCty != "City or Airport") {
							suggest_Dest_Arr_City(departureCty, arrivalCty, airorCityarray, document, form, uri);
							return true;
						} else {
							alert("Please enter a valid arrival location!");
							document.getElementById("arrivalCity").focus();
							return false;
						}
					} else {
						alert("Please enter a valid departure location!");
						document.getElementById("departureCity").focus();
						return false;
					}
				} else {
					var deptCty = document.getElementById("departureCity").value;
					if (deptCty != "" && deptCty.length > 2 && deptCty != "City or Airport") {
						validate_Cty_Arpt(deptCty, 'D', airorCityarray, document, form, uri);
						return true;
					} else {	
						alert("Please enter a valid departure location!");
						document.getElementById("departureCity").focus();
						return false;
					}
				}
			} else if (document.flightsForm.AJAXCheck1.value == '0' && document.flightsForm.AJAXCheck.value != '0') {
				var arrCty = document.getElementById("arrivalCity").value;
				if (arrCty != "" && arrCty.length > 2 && arrCty != "City or Airport") {
					validate_Cty_Arpt(arrCty, 'A', airorCityarray, document, form, uri);
					return true;
				} else {
					alert("Please enter a valid arrival location!");
					document.getElementById("arrivalCity").focus();
					return false;
				}
			} else if (document.flightsForm.AJAXCheck.value != '0' && document.flightsForm.AJAXCheck1.value != '0') {
				totalAdvertiser	= countFlightAdvertiser;
				url = getCityorAirportUrl(form,'F1');
			}
		} else {
			if(document.flightsForm.AJAXCheck.value == '0') {	
				if (document.flightsForm.AJAXCheck1.value == '0') {	
					document.getElementById("departureCity").focus();
					var departureCty = document.getElementById("departureCity").value;
					var arrivalCty = document.getElementById("arrivalCity").value;
					if (departureCty != "" && departureCty.length > 2 && departureCty != "City or Airport") {
						if (arrivalCty != "" && arrivalCty.length > 2 && arrivalCty != "City or Airport") {
							suggest_Dest_Arr_City(departureCty, arrivalCty, airorCityarray, document, form, 'U');
							return true;
						} else {
							alert("Please enter a valid arrival location!");
							document.getElementById("arrivalCity").focus();
							return false;
						}
					} else {
						alert("Please enter a valid departure location!");
						document.getElementById("departureCity").focus();
						return false;
					}
				} else {
					var deptCty = document.getElementById("departureCity").value;
					if (deptCty != "" && deptCty.length > 2 && deptCty != "City or Airport") {
						validate_Cty_Arpt(deptCty, 'D', airorCityarray, document, form, 'U');
						return true;
					} else {	
						alert("Please enter a valid departure location!");
						document.getElementById("departureCity").focus();
						return false;
					}
				}
			} else if (document.flightsForm.AJAXCheck1.value == '0' && document.flightsForm.AJAXCheck.value != '0') {
				var arrCty = document.getElementById("arrivalCity").value;
				if (arrCty != "" && arrCty.length > 2 && arrCty != "City or Airport") {
					validate_Cty_Arpt(arrCty, 'A', airorCityarray, document, form, 'U');
					return true;
				} else {
					alert("Please enter a valid arrival location!");
					document.getElementById("arrivalCity").focus();
					return false;
				}
			} else if (document.flightsForm.AJAXCheck.value != '0' && document.flightsForm.AJAXCheck1.value != '0') {
				totalAdvertiser	= countFlightAdvertiser;
				url = getCityorAirportUrl(form,'F');
			}
		}
	} else if(form.name=='hotelsForm') {
		if(document.hotelsForm.AJAXCheck.value == '0') {	
			document.getElementById("city").focus();
			var city = document.getElementById("city").value;
			if (city != "" && city.length > 2) {
				validate_Cty_Arpt(city, 'HF', airorCityarray, document, form, 'U');
				return true;
			} else {
				alert("Please enter a valid city location!");
				document.getElementById("city").focus();
				return false;
			}
		} else {
			if(!validateDate('hotels_date_checkin_CTL','check-in') || !validateDate('hotels_date_checkout_CTL','check-out'))
				return false;
			if(!compareDate('hotels_date_checkin_CTL','check-in','hotels_date_checkout_CTL','check-out'))
				return false;		
			totalAdvertiser	= countHotelAdvertiser;
			url = getCityorAirportUrl(form,'H');
		}
	}else if(form.name=='superpricecheck'){
		  if(!validateDate('hotels_date_checkin_CTL','check-in') || !validateDate('hotels_date_checkout_CTL','check-out'))
				return false;
		  if(!compareDate('hotels_date_checkin_CTL','check-in','hotels_date_checkout_CTL','check-out'))
				return false;	
		  totalAdvertiser = airorCityarray;
		  url = getCityorAirportUrl(form,'P');
		  	
		
	}else if(form.name=='innerForm'){
		if(document.innerForm.AJAXCheck.value == '0') {	
			document.getElementById("innerCity").focus();
			var city = document.getElementById("innerCity").value;
			if (city != "" && city.length > 2) {
				validate_Cty_Arpt(city, 'innerForm', airorCityarray, document, form, 'U');
				return true;
			} else {
				alert("Please enter a valid city location!");
				document.getElementById("innerCity").focus();
				return false;
			}
		} else {
			if(!validateDate('checkInDate0','check-in') || !validateDate('checkOutDate0','check-out'))
				return false;
			if(!compareDate('checkInDate0','check-in','checkOutDate0','check-out'))
				return false;		
			totalAdvertiser	= countHotelAdvertiser;
			url = getCityorAirportUrl(form,'innerForm');
		}
			
	} else if(form.name.indexOf('popAdvertiserForm')!=-1){
		if(!checkSelectdBox(form)) {
			alert("Please check at least one website to search.");
			return false;
		}
		name 		= form.name;
		formCheck	= name.substring(17);
		checkin		= document.getElementById("checkInDate"+(formCheck-1)).value;
		checkout	= document.getElementById("checkOutDate"+(formCheck-1)).value;

		if(!validateDate("checkInDate"+(formCheck-1),'check-in') || !validateDate("checkOutDate"+(formCheck-1),'check-out'))
			return false;
		if(!compareDate("checkInDate"+(formCheck-1),'check-in',"checkOutDate"+(formCheck-1),'check-out'))
			return false;		
		totalAdvertiser	= airorCityarray;
		url = getCityorAirportUrl(form,'popAdvertiserForm');
		
			
	} else {
		totalAdvertiser	= airorCityarray;
		url = getCityorAirportUrl(form,'CH');
	}
	if(airorCityarray=="1") {
		form.submit();
		return true;
	}
	
	for(var i=0; i<form.elements.length; i++) {
		if (form.elements[i].type=="checkbox") {
			if(form.elements[i].name.indexOf('HCB-')!=-1 && form.name=="innerForm") {
			
				if(form.innerCity!= null)
					city = form.innerCity.value;	
				countTotal	= Number(countTotal)+1;
				if(form.elements[i].checked== true) {
					name = form.elements[i].name;
						actualPid = name.substring(name.indexOf("-")+1);
						for (var j=0; j<totalAdvertiser.length; j++) {
							pId = totalAdvertiser[j].substring(0,totalAdvertiser[j].indexOf(','));
							if(pId==actualPid) {
								countSelected= Number(countSelected)+1;
								finalURL = totalAdvertiser[j].substring(totalAdvertiser[j].indexOf(',')+1);
								if(finalURL.indexOf("mtg_logURL")!=-1) {
									url = url.substring(0,url.indexOf("city_name=")+10)+ getActualCity(city,"C") + url.substring(url.indexOf("&mtg_cindt"));									
								}
								finalURL = finalURL + url;
								openWinsNew[count++] = finalURL;
							}						
						}
					
				}
			
			} else if(form.elements[i].name.indexOf('CB-')!=-1) {
				if(form.city!= null)
					city = form.city.value;	
				countTotal	= Number(countTotal)+1;
				if(form.elements[i].checked== true) {
					name = form.elements[i].name;
					if(name.indexOf('CB-')!=-1) {
						actualPid = name.substring(name.indexOf("-")+1);
						for (var j=0; j<totalAdvertiser.length; j++) {
							pId = totalAdvertiser[j].substring(0,totalAdvertiser[j].indexOf(','));
							if(pId==actualPid) {
								countSelected= Number(countSelected)+1;
								finalURL = totalAdvertiser[j].substring(totalAdvertiser[j].indexOf(',')+1);
								if(finalURL.indexOf("mtg_logURL")!=-1) {
									url = url.substring(0,url.indexOf("city_name=")+10)+ getActualCity(city,"C") + url.substring(url.indexOf("&mtg_cindt"));									
								}
								finalURL = finalURL + url;
								openWinsNew[count++] = finalURL;
							}						
						}
					}	
				}
			} 
		}
	}
	if(!popupBlockerOn) {
		advertiserLightbox(countTotal,countSelected,openWinsNew);		
	}else {
		if(openWinsNew!= null) {
			for(i=0;i<openWinsNew.length;i++) {
				url	 =  openWinsNew[i].substring(openWinsNew[i].indexOf(",")+1);
				adURLArray[i] = url;			
			}	
			openStackedWindows();
		}
	}
	if(form.name.indexOf('popAdvertiserForm')!=-1 || form.name.indexOf('innerForm')!=-1) {
			tgCloseHtmlLightBox();
	}
	
	count = 0;
	countTotal = 0; 
	countSelected = 0;	
}

function validate_Cty_Arpt(city, identifier, airorCityarray, document, form, uniResrcInd) {	
	var url = "/autocomplete?action=complete&lookValue=" + city;
	var req = createXmlHttpObj();
		 req.onreadystatechange = function() {
		     if (req.readyState == 4) {
		         if (req.status == 200) {         	
					populate_Cty_Arpt(req.responseText, identifier, 'N', airorCityarray, document, form, uniResrcInd);
		         } 
				 else if (req.status == 204) {	
		             return null;
		         }
		     }
		 };
		 req.open("GET", url, true);
		 req.send(null); 
}

function populate_Cty_Arpt(resp, identifier, ind, airorCityarray, document, form, uri) {	
	var url = "";
	var	totalAdvertiser	= new Array();
	count 				= 0;
	countTotal 			= 0; 
	countSelected 		= 0;
	var cityList = new Array();
	var cityArr = new Array();
	var cty = "";
	var id = "";
	var cty1 = "";
	var id1 = "";
	var airport = new Array();
	var city = new Array();
	if (form.name=='hotelsForm' || form.name=='carsForm' || form.name=='flightsForm'||form.name=='innerForm') {
		if (form.name=='hotelsForm') {
			if (resp == null || resp == "") {
				alert("Please enter a valid City/Airport search!");
				document.getElementById("city").focus();
				return false;
			}
			if (resp.indexOf("||") != -1 && resp.substr(0, 2) != '||') {
				cityList = resp.split("||")[0];
			} else {
				cityList = resp.split("||")[1];
			}
		} else if (form.name=='carsForm') {
			if (resp == "") {
				alert("Please enter a valid City/Airport search!");
				document.getElementById("pickupCity").focus();
				return false;
			} else if (resp != "" && resp.indexOf(') -') == -1) {
				alert("Please enter a valid City/Airport search!");
				document.getElementById("pickupCity").focus();
				return false;
			}
			cityArr = resp.split("||");
			for (var i = 0; i < cityArr.length; i++) {
				if (cityArr[i].indexOf(') -') != -1) {
					airport.push(cityArr[i]);
				}
			}
			cityList = airport[0];
		} else if (form.name=='flightsForm') {
			if (resp == "") {
				if (resp.indexOf('Des:N') != -1) {
					alert("Please enter a valid departure location!");
					document.getElementById("departureCity").focus();
					return false;
				} if (resp.indexOf('Arr:N') != -1) {
					alert("Please enter a valid arrival location!");
					document.getElementById("arrivalCity").focus();
					return false;
				} else if (resp.indexOf('Des:N') != -1 && resp.indexOf('Arr:N') != -1) {
					alert("Please enter a valid City/Airport search!");
					document.getElementById("departureCity").focus();
					return false;
				} else {
					alert("Please enter a valid City/Airport search!");
					document.getElementById("departureCity").focus();
					return false;
				}
			} else if (resp != "") {
				if (resp.indexOf('Des:N') != -1) {
					alert("Please enter a valid departure location!");
					document.getElementById("departureCity").focus();
					return false;
				} if (resp.indexOf('Arr:N') != -1) {
					alert("Please enter a valid arrival location!");
					document.getElementById("arrivalCity").focus();
					return false;
				} if (resp.indexOf('Y:ctyArptFrom:N') != -1) {
					alert("Please enter a valid departure location!");
					document.getElementById("departureCity").focus();
					return false;
				} else if (resp.indexOf('Y:ctyArptTo:N') != -1) {
					alert("Please enter a valid arrival location!");
					document.getElementById("arrivalCity").focus();
					return false;
				}
			}
			cityArr = resp.split("||");
			for (var i = 0; i < cityArr.length; i++) {
				if (cityArr[i].indexOf(') -') != -1) {
					airport.push(cityArr[i]);
				} else if (cityArr[i].indexOf(') -') == -1) {
					city.push(cityArr[i]);
				}
			}
		}  else if (form.name=='innerForm') {
			if (resp == null || resp == "") {
				alert("Please enter a valid City/Airport search!");
				document.getElementById("innerCity").focus();
				return false;
			}
			if (resp.indexOf("||") != -1 && resp.substr(0, 2) != '||') {
				cityList = resp.split("||")[0];
			} else {
				cityList = resp.split("||")[1];
			}
		}
		if (cityList != '' || airport != '' || city != '') {
			if(form.name !='flightsForm') {
				cty = cityList.split("|")[0];
				id = cityList.split("|")[1];
			} else if (form.name == 'flightsForm' && ind == 'DA') {	
				if (airport.length >= 2 && airport[0] != '' || airport[0] != 'undefined' && airport[1] != '' || airport[1] != 'undefined') {
					cty = airport[0].split("|")[0];
					id = airport[0].split("|")[1];
					cty1 = airport[1].split("|")[0];
					id1 = airport[1].split("|")[1];
				}
			} else if (form.name=='flightsForm' && ind == 'N') {
					if (airport.length == 0) {
						alert("Please enter a valid Airport location!");
						return false;
					} else {
						cty = airport[0].split("|")[0];
						id = airport[0].split("|")[1];
					}
			}
			if (identifier == 'HF') {
				document.getElementById("city").value = cty;
				document.hotelsForm.cityId.value = id;
				if(!validateDate('hotels_date_checkin_CTL','check-in') || !validateDate('hotels_date_checkout_CTL','check-out'))
				return false;
				if(!compareDate('hotels_date_checkin_CTL','check-in','hotels_date_checkout_CTL','check-out'))
				return false;		
				totalAdvertiser	= countHotelAdvertiser;
				url = getCityorAirportUrl(form,'H');
			} 
			if (identifier == 'RF') {	
				document.getElementById("pickupCity").value = cty;
				//document.getElementById("dropoffCity").value = cty;
				document.carsForm.cityId.value = id;
				//document.carsForm.cityId1.value = id;
				if(!validateDate('Rental_Car_Pick_Up_Date','pick-up') || !validateDate('Rental_Car_Drop_Off_Date','drop-off'))
					return false;
				if(!compareDate('Rental_Car_Pick_Up_Date','pick-up','Rental_Car_Drop_Off_Date','drop-off'))
					return false;		
				totalAdvertiser	= countCarAdvertiser;
				url = getCityorAirportUrl(form,'C');
			} else if (identifier == 'D' && ind == 'N') {
				document.getElementById('departureCity').value = cty;
				document.flightsForm.cityId.value = id;
				totalAdvertiser	= countFlightAdvertiser;
				if (uri == 'F1') {
					url = getCityorAirportUrl(form,'F1');
				} else {
					url = getCityorAirportUrl(form,'F');
				}
				if(!validateDate('airlines_date_departure_CTL','depature') || !validateDate('airlines_date_return_CTL','return'))
					return false;
				if(!compareDate('airlines_date_departure_CTL','departure','airlines_date_return_CTL','return'))
					return false;
			} else if (identifier == 'A' && ind == 'N') {
				document.getElementById('arrivalCity').value = cty;
				document.flightsForm.cityId1.value = id;
				totalAdvertiser	= countFlightAdvertiser;
				if (uri == 'F1') {
					url = getCityorAirportUrl(form,'F1');
				} else {
					url = getCityorAirportUrl(form,'F');
				}
				if(!validateDate('airlines_date_departure_CTL','depature') || !validateDate('airlines_date_return_CTL','return'))
					return false;
				if(!compareDate('airlines_date_departure_CTL','departure','airlines_date_return_CTL','return'))
					return false;
			} else if (ind == 'DA') {
				if (identifier == 'D') {
					document.getElementById("departureCity").value = cty;
					document.flightsForm.cityId.value = id;				 
					document.getElementById("arrivalCity").value = cty1;
					document.flightsForm.cityId1.value = id1;
				}
					totalAdvertiser	= countFlightAdvertiser;
					if (uri == 'F1') {
					url = getCityorAirportUrl(form,'F1');
					} else {
					url = getCityorAirportUrl(form,'F');
					}
					if(!validateDate('airlines_date_departure_CTL','depature') || !validateDate('airlines_date_return_CTL','return'))
					return false;
					if(!compareDate('airlines_date_departure_CTL','departure','airlines_date_return_CTL','return'))
					return false;
			} else if (identifier == 'innerForm') {
				document.getElementById("innerCity").value = cty;
				document.innerForm.cityId.value = id;
				if(!validateDate('checkInDate0','check-in') || !validateDate('checkOutDate0','check-out'))
				return false;
				if(!compareDate('checkInDate0','check-in','checkOutDate0','check-out'))
				return false;		
				totalAdvertiser	= airorCityarray;
				url = getCityorAirportUrl(form,'innerForm');
			} 
		}
	} else {
		totalAdvertiser	= airorCityarray;
		url = getCityorAirportUrl(form,'CH');
	}
	if(airorCityarray=="1") {
		form.submit();
		return true;
	}

	for(var i=0; i<form.elements.length; i++) {
		if (form.elements[i].type=="checkbox") {
			if(form.elements[i].name.indexOf('HCB-')!=-1 && form.name=="innerForm") {
				if(form.innerCity!= null)
					city = form.innerCity.value;	
				countTotal	= Number(countTotal)+1;
				if(form.elements[i].checked== true) {
					name = form.elements[i].name;
						actualPid = name.substring(name.indexOf("-")+1);
						for (var j=0; j<totalAdvertiser.length; j++) {
							pId = totalAdvertiser[j].substring(0,totalAdvertiser[j].indexOf(','));
							if(pId==actualPid) {
								countSelected= Number(countSelected)+1;
								finalURL = totalAdvertiser[j].substring(totalAdvertiser[j].indexOf(',')+1);
								if(finalURL.indexOf("mtg_logURL")!=-1) {
									url = url.substring(0,url.indexOf("city_name=")+10)+ getActualCity(city,"C") + url.substring(url.indexOf("&mtg_cindt"));									
								}
								finalURL = finalURL + url;
								openWinsNew[count++] = finalURL;
							}						
						}
					
				}
		
		} else if(form.elements[i].name.indexOf('CB-')!=-1) {
				if(form.city!= null)
					city = form.city.value;	
				countTotal	= Number(countTotal)+1;
				if(form.elements[i].checked== true) {
					name = form.elements[i].name;
					if(name.indexOf('CB-')!=-1) {
						actualPid = name.substring(name.indexOf("-")+1);
						for (var j=0; j<totalAdvertiser.length; j++) {
							pId = totalAdvertiser[j].substring(0,totalAdvertiser[j].indexOf(','));
							if(pId==actualPid) {
								countSelected= Number(countSelected)+1;
								finalURL = totalAdvertiser[j].substring(totalAdvertiser[j].indexOf(',')+1);
								if(finalURL.indexOf("mtg_logURL")!=-1) {
									url = url.substring(0,url.indexOf("city_name=")+10)+ getActualCity(city,"C") + url.substring(url.indexOf("&mtg_cindt"));									
								}
								finalURL = finalURL + url;
								openWinsNew[count++] = finalURL;
							}						
						}
					}	
				}
			}
		}
	}
	if(!popupBlockerOn) {
		advertiserLightbox(countTotal,countSelected,openWinsNew);		
	} else {
		if(openWinsNew!= null) {
			for(i=0;i<openWinsNew.length;i++)
			{
				url	 =  openWinsNew[i].substring(openWinsNew[i].indexOf(",")+1);
				adURLArray[i] = url;			
			}	
			openStackedWindows();
		}
	}
	if(form.name.indexOf('innerForm')!=-1) {
			tgCloseHtmlLightBox();
	}
	count = 0;
	countTotal = 0; 
	countSelected = 0;	
}

function suggest_Dest_Arr_City(ctyDest, ctyArr, airorCityarray, document, form) {
	var url = "/autocomplete?action=complete&lookValue=" + ctyDest + ":" + ctyArr;
	var list = new Array();
	var req = createXmlHttpObj();
		 req.onreadystatechange = function() {
		     if (req.readyState == 4) {
		         if (req.status == 200) {
					populate_Cty_Arpt (req.responseText, 'D', 'DA', airorCityarray, document, form);
		         } else if (req.status == 204) {
		             return null;
		         }
		     }
		 };
		 req.open("GET", url, true);
		 req.send(null); 	
}

function createXmlHttpObj(){ 
		var xmlHttpObj = null;
		if(window.XMLHttpRequest) {
			xmlHttpObj = new XMLHttpRequest();
		}
		else if(window.ActiveXObject) {
			xmlHttpObj = new ActiveXObject("Microsoft.XMLHTTP");
		}
		return xmlHttpObj;
};

function getActualCity(city,check){
	var actualCity = "";
	if(check != null && check == "C"){
		if(city.indexOf("(") != -1){
			actualCity = city.substring(city.lastIndexOf("-")+2,city.lastIndexOf(","));	
		}else{
			actualCity = city.substring(0,city.indexOf(','));
		}			
	}else if(city.indexOf("(") != -1){
		actualCity = "A|"+city.substring(0,3);
	}else{
		actualCity = "C|"+city.substring(0,city.indexOf(','));
	}
 return actualCity;	
}

function fnc_tvl_htl() {
	var url = '';
	var rooms = document.getElementById('number_of_rooms').value;
	if (rooms == 10) {
		var serverHost = 'http://mtg.hotelplanner.com/Priceline.cfm';
		var city = document.getElementById('city').value;
		var checkin = document.getElementById('hotels_date_checkin_CTL').value;
		var checkout = document.getElementById('hotels_date_checkout_CTL').value;
		var adults = document.getElementById("adults").value;
		if (city == 'null') { 
			city = '';
		}
		if (city.indexOf('United States') != -1) {
			city = city.substring(0, city.indexOf('United States') - 2);
		} else if(city.indexOf("United States") == -1) {
			// do nothing
		}
		if (city.indexOf('(') != -1) {
			city = city.substring(city.indexOf(') -') + 4);
		}
		url = serverHost + '?city=' + city + '&CheckIn=' + checkin + '&CheckOut=' + checkout;
		fnchtlPlanr(url);
	} else {
		return false;
	}
}

	function fnc_flt_htl(thisObj) {
		var url = '';
		var rooms = thisObj.number_of_rooms.value;
		if (rooms == 10) {
			var serverHost = 'http://mtg.hotelplanner.com/Priceline.cfm';
			var city = document.getElementById('city').value;
			var checkin = document.getElementById('hotels_date_checkin_CTL').value;
			var checkout = document.getElementById('hotels_date_checkout_CTL').value;
			var adults = thisObj.adults.value;
			if (city == 'null') { 
				city = '';
			}
			if (city.indexOf('United States') != -1) {
				city = city.substring(0, city.indexOf('United States') - 2);
			} else if(city.indexOf("United States") == -1) {
				// do nothing
			}
			if (city.indexOf('(') != -1) {
				city = city.substring(city.indexOf(') -') + 4);
			}
			url = serverHost + '?city=' + city + '&CheckIn=' + checkin + '&CheckOut=' + checkout;
			fnchtlPlanr(url);
		} else {
			return false;
		}
	}

function getCityorAirportUrl(form,type) {
	var cityAirportSearch = '';
	var uri = window.location.href;
	var searchTextArr = [];
	var iair = uri.indexOf('air');
	var iflights = uri.indexOf('flights');
	var itravel = uri.indexOf('travel');
	var ivacations = uri.indexOf('vacations');
	var icars = uri.indexOf('cars');
	url = "";
	if(type=='H') {
		cityAirportSearch = form.city.value;
		ciryorairport 	= getActualCity(form.city.value).split("|");
		checkin			= document.getElementById("hotels_date_checkin_CTL").value;
		checkout		= document.getElementById("hotels_date_checkout_CTL").value;
		url 			= "&mtg_cityorAirCk="+ciryorairport[0]+"&mtg_cityorAirId="+form.cityId.value
							+"&hotel_city_name="+ciryorairport[1]
							+"&mtg_cindt="+checkin
							+"&mtg_coutdt="+checkout
							+"&mtg_numnight="+returnDays(checkin, checkout)
							+"&mtg_numAdult="+form.adults.value
							+"&mtg_numroom="+form.number_of_rooms.value;
		if (iair!= -1 || iflights != -1 || itravel != -1 || ivacations != -1 || icars != -1) {
			if (cityAirportSearch.indexOf(') - ') != -1) {
				var citySearch = cityAirportSearch.substring(cityAirportSearch.indexOf(') - ') + 4, cityAirportSearch.indexOf(','));
				openVCPopHtl(citySearch);
			} else {
				//var searchTextArr = [];
				searchTextArr = cityAirportSearch.split(',');
				openVCPopHtl(searchTextArr[0]);
			}
		}
	}else if(type=='F') {
		cityAirportSearch = form.arrivalCity.value;
		ciryorairport 	= getActualCity(form.departureCity.value).split("|");
		ciryorairport1 	= getActualCity(form.arrivalCity.value).split("|");
		checkin			= document.getElementById("airlines_date_departure_CTL").value;
		checkout		= document.getElementById("airlines_date_return_CTL").value;
		url 			= "&mtg_depLoc="+ciryorairport[1]
							+"&mtg_arrivalLoc="+ciryorairport1[1]+"&mtg_cityorAirId="+form.cityId.value
							+"&mtg_dropCityorAirId="+form.cityId1.value+"&mtg_depDate=" +checkin
							+ "&mtg_retDate="+checkout
							+"&mtg_numAdult="+form.num_tickets.value;
		if (iair!= -1 || iflights != -1 || itravel != -1 || ivacations != -1 || icars != -1) {
			if (cityAirportSearch.indexOf(') - ') != -1) {
				var citySearch = cityAirportSearch.substring(cityAirportSearch.indexOf(') - ') + 4, cityAirportSearch.indexOf(','));
				openVCPopFlights(citySearch);
			} else {
				searchTextArr = cityAirportSearch.split(',');
				openVCPopFlights(searchTextArr[0]);
			}
		}
	} else if(type=='F1') {
		cityAirportSearch = form.arrivalCity.value;
		ciryorairport1 	= getActualCity(form.arrivalCity.value).split("|");
		ciryorairport 	= getActualCity(form.departureCity.value).split("|");
		checkin			= document.getElementById("airlines_date_departure_CTL").value;
		checkout		= document.getElementById("airlines_date_return_CTL").value;
		url 			= "&mtg_depLoc="+ciryorairport[1]
							+"&mtg_arrivalLoc="+ciryorairport1[1]+"&mtg_cityorAirId="+form.cityId.value
							+"&mtg_dropCityorAirId="+form.cityId1.value+"&mtg_depDate=" +checkin
							+ "&mtg_retDate="+checkout
							+"&mtg_numAdult="+form.num_tickets.value;
		if (iair!= -1 || iflights != -1 || itravel != -1 || ivacations != -1 || icars != -1) {
			if (cityAirportSearch.indexOf(') - ') != -1) {
				var citySearch = cityAirportSearch.substring(cityAirportSearch.indexOf(') - ') + 4, cityAirportSearch.indexOf(','));
				openVCPopFlights(citySearch);
			} else {
				searchTextArr = cityAirportSearch.split(',');
				openVCPopFlights(searchTextArr[0]);
			}
		}
	}
	else if(type=='C') {	
		cityAirportSearch = form.pickupCity.value;
		ciryorairport 	= getActualCity(form.pickupCity.value).split("|");
		ciryorairport1 	= getActualCity(form.dropoffCity.value).split("|");
		if(ciryorairport1[1]==null || ciryorairport1[1]=="")
		ciryorairport1[0] = ciryorairport[0];
		checkin			= document.getElementById("Rental_Car_Pick_Up_Date").value;
		checkout		= document.getElementById("Rental_Car_Drop_Off_Date").value;
		url 			= "&mtg_cityorAirCk="+ciryorairport[0]+"&mtg_cityorAirId="+form.cityId.value
								+"&mtg_dropCityorAirId="+form.cityId1.value
								+"&mtg_pickloc="+ciryorairport[1]+"&mtg_droploc="+ciryorairport1[1]
								+"&mtg_pickdt=" +checkin+"&mtg_dropdt="+checkout
								+"&mtg_numnight="+returnDays(checkin, checkout)+"&mtg_cityorAirCk1="+ciryorairport1[0]
								+"&mtg_picktm="+form.pickupTime.value
								+"&mtg_droptm="+form.dropoffTime.value;
		if (iair !=-1 || iflights != -1 || itravel != -1 || ivacations != -1 || icars != -1) {
			if (cityAirportSearch.indexOf(') - ') != -1) {
				var citySearch = cityAirportSearch.substring(cityAirportSearch.indexOf(') - ') + 4, cityAirportSearch.indexOf(','));
				openVCPopRC(citySearch);
			} else {
				searchTextArr = cityAirportSearch.split(',');
				openVCPopRC(searchTextArr[0]);
			}
		}
		}else if(type=='P'){	   
		   url 		        = "&mtg_cindt="+form.hotels_date_checkin_CTL.value
									+"&mtg_coutdt="+form.hotels_date_checkout_CTL.value
									+"&mtg_numnight="+returnDays(form.hotels_date_checkin_CTL.value, form.hotels_date_checkout_CTL.value)
									+"&mtg_numAdult="+form.adults.value
									+"&mtg_numroom="+form.rooms.value;
		   
	 }else if(type=='L'){
	   ciryorairport 	= getActualCity(form.lbCity.value).split("|");
	   url              ="&mtg_cityorAirCk="+ciryorairport[0]+"&mtg_cityorAirId="+form.cityId.value+"&hotel_city_name="+ciryorairport[1]+"&mtg_cindt="+form.checkInDate0.value
								+"&mtg_coutdt="+form.checkOutDate0.value
								+"&mtg_numnight="+returnDays(form.checkInDate0.value, form.checkOutDate0.value)
								+"&mtg_numAdult="+form.lightBoxadults.value
								+"&mtg_numroom="+form.lightBoxrooms.value; 
	}else if(type=='innerForm') {
		cityAirportSearch = form.innerCity.value;
		ciryorairport 	= getActualCity(form.innerCity.value).split("|");
		checkin			= document.getElementById("checkInDate0").value;
		checkout		= document.getElementById("checkOutDate0").value;
		url 			= "&mtg_cityorAirCk="+ciryorairport[0]+"&mtg_cityorAirId="+form.cityId.value
							+"&hotel_city_name="+ciryorairport[1]
							+"&mtg_cindt="+checkin
							+"&mtg_coutdt="+checkout
							+"&mtg_numnight="+returnDays(checkin, checkout)
							+"&mtg_numAdult="+form.lightBoxadults.value
							+"&mtg_numroom="+form.lightBoxrooms.value;
	
	} else if (type=='popAdvertiserForm'){
		hotelName	= form.hotelName.value;
		cityName	= form.cityName.value;
		name 		= form.name;
		formCheck	= name.substring(17);
		checkin		= document.getElementById("checkInDate"+(formCheck-1)).value;
		checkout	= document.getElementById("checkOutDate"+(formCheck-1)).value;
		url 	= "&mtg_cityorAirCk=C&mtg_cityorAirId="+form.actualCityId.value
					+"&hotel_city_name="+cityName
					+"&mtg_cindt="+checkin
					+"&mtg_coutdt="+checkout
					+"&mtg_numnight="+returnDays(checkin, checkout)
					+"&mtg_numAdult="+form.adults.value
					+"&mtg_numroom="+form.rooms.value;
	}else{
		hotelName	= form.hotelName.value;
		cityName	= form.cityName.value;
		name 		= form.name;
		formCheck	= name.substring(name.length-1);
		checkin		= document.getElementById("checkInDate"+(formCheck-1)).value;
		checkout	= document.getElementById("checkOutDate"+(formCheck-1)).value;
		url 	= "&mtg_cityorAirCk=C&mtg_cityorAirId="+form.actualCityId.value
					+"&hotel_city_name="+cityName
					+"&mtg_cindt="+checkin
					+"&mtg_coutdt="+checkout
					+"&mtg_numnight="+returnDays(checkin, checkout)
					+"&mtg_numAdult="+form.adults.value
					+"&mtg_numroom="+form.rooms.value;
	}
	return url;
}
function checkSelectdBox(form){ 		
	for (var i=0; i<form.elements.length; i++){
		if (form.elements[i].type=="checkbox"){			
      		if(form.elements[i].name.indexOf("CB-")!=-1){
	    		if(form.elements[i].checked)
					return true;	     			
			}
	 	}
	}
	return false;	
}
function validText(form,field){
	var name = document.getElementById(field).value;	
	if ( name== "" || name=="City or Airport"){
		alert("Please enter a valid city or airport code");
		document.getElementById(field).focus();
		return false;
	}
	return true;
}
function validateDate(dateField,name){
	if(!isDate(document.getElementById(dateField).value,name)){
		document.getElementById(dateField).focus();
		return false;
	}
	return true;
}

function compareDate(from,fromName,to,toName){
	var str1  = document.getElementById(from).value;
	var str2  = document.getElementById(to).value;
	var dt1   = parseInt(str1.substring(0,2),10);
	var mon1  = parseInt(str1.substring(3,5),10);
	var yr1   = parseInt(str1.substring(6,10),10);
	var dt2   = parseInt(str2.substring(0,2),10);
	var mon2  = parseInt(str2.substring(3,5),10);
	var yr2   = parseInt(str2.substring(6,10),10);
	var date1 = new Date(yr1, dt1, mon1);
	var date2 = new Date(yr2, dt2, mon2); 
	var one_day=1000*60*60*24;
	var diff = date2.getTime() - date1.getTime();
	var num_days = (((diff / 1000) / 60) / 60) / 24;
	
	if(Date.parse(document.getElementById(from).value) <= new Date){
		alert("Your "+fromName+" date must be today or a future date.");
		return false;
	}
	if (Date.parse(document.getElementById(from).value) >= Date.parse(document.getElementById(to).value)) {
		alert("Your "+fromName+" date must be prior to your "+toName+" date.");
		return false;
	}
	if(num_days>=365){
		alert("Your "+toName+" date is too far in advance. Please choose a date within the next 11 months.");
		return false;
	}
	return true;
}
//date validation method

var dtCh= "/";
var minYear=1800;
var maxYear=2100;

function isInteger(s){
	var i;
    for (i = 0; i < s.length; i++){   
        // Check that current character is number.
        var c = s.charAt(i);
        if (((c < "0") || (c > "9"))) return false;
    }
    // All characters are numbers.
    return true;
}

function stripCharsInBag(s, bag){
	var i;
    var returnString = "";
    // Search through string's characters one by one.
    // If character is not in bag, append to returnString.
    for (i = 0; i < s.length; i++){   
        var c = s.charAt(i);
        if (bag.indexOf(c) == -1) returnString += c;
    }
    return returnString;
}

function daysInFebruary (year){
	// February has 29 days in any year evenly divisible by four,
    // EXCEPT for centurial years which are not also divisible by 400.
    return (((year % 4 == 0) && ( (!(year % 100 == 0)) || (year % 400 == 0))) ? 29 : 28 );
}
function DaysArray(n) {
	for (var i = 1; i <= n; i++) {
		this[i] = 31
		if (i==4 || i==6 || i==9 || i==11) {this[i] = 30}
		if (i==2) {this[i] = 29}
   } 
   return this
}

function isDate(dtStr,name){
	var currentYear = new Date().getYear();
	var dtCh= "/";
	var daysInMonth = DaysArray(12)
	var pos1=dtStr.indexOf(dtCh)
	var pos2=dtStr.indexOf(dtCh,pos1+1)
	var strMonth=dtStr.substring(0,pos1)
	var strDay=dtStr.substring(pos1+1,pos2)
	var strYear=dtStr.substring(pos2+1)
	strYr=strYear
	if (strDay.charAt(0)=="0" && strDay.length>1) strDay=strDay.substring(1)
	if (strMonth.charAt(0)=="0" && strMonth.length>1) strMonth=strMonth.substring(1)
	for (var i = 1; i <= 3; i++) {
		if (strYr.charAt(0)=="0" && strYr.length>1) strYr=strYr.substring(1)
	}
	month=parseInt(strMonth)
	day=parseInt(strDay)
	year=parseInt(strYr)
	if (pos1==-1 || pos2==-1){
		alert("The date format should be : mm/dd/yyyy")
		return false
	}
	if (strMonth.length<1 || month<1 || month>12){
		alert("Please enter a valid month")
		return false
	}
	if (strDay.length<1 || day<1 || day>31 || (month==2 && day>daysInFebruary(year)) || day > daysInMonth[month]){
		alert("Please enter a valid day")
		return false
	}
	if (strYear.length != 4 || year==0 || year<minYear || year>maxYear){
		alert("Your "+name+" date must be today or a future date.");
		return false
	}
	if (dtStr.indexOf(dtCh,pos2+1)!=-1 || isInteger(stripCharsInBag(dtStr, dtCh))==false){
		alert("Please enter a valid date")
		return false
	}
return true
}

function fnchtlPlanr(servUrl) {
	window.open(servUrl, "hotelGroupPlanner",'left=5,top=5,screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=800,width=800,height=600');		
}

function checkAllAd(checkValue,form){
	if(checkValue){
		for (var i=0; i<form.elements.length; i++){
			if (form.elements[i].type=="checkbox"){
				form.elements[i].checked=true;				
			}
		}     		
	}
	if(!checkValue){
		for (var i=0; i<form.elements.length; i++){
			if (form.elements[i].type=="checkbox"){
				form.elements[i].checked=false;	
			}
		}
	}
}

function showLightBox(){
	document.getElementById('fulldivshow').style.display='';
	document.getElementById('tgMyOwnDivIDNew').style.display='';	
}

function hideLightBox(){
	document.getElementById('fulldivshow').style.display='none';
	document.getElementById('tgMyOwnDivIDNew').style.display='none';
	openWinsNew = new Array();	
}

		
function returnDays(checkin, checkout){
	var dCheckinDate 	= new Date(checkin);
	var dCheckoutDate 	= new Date(checkout);
	var difference 		= dCheckoutDate - dCheckinDate;
	var days 			= Math.round(difference/(1000*60*60*24));
	return days;
}

function openPop()
{
	var searchText = document.getElementById("search").value;
      var page = "http://www.hotelsbycity.com/hotels/popMTG.php?key="+searchText+"&vcid=43683&headerText=Still looking?&titleText=Still looking?&showURL=yes";
      var windowprops = "resizable=1,scrollbars=1,menubar=1,location=1,toolbar=1,titlebar=1,width=590,height=505, top=50, left=50";
      newWindow = window.open(page, 'popMTG', windowprops);
      newWindow.blur();
}

//pop under for Valid Click Link Agent standalone cars tab
function openPopLA()
{
	var searchText = document.getElementById("pickupCity").value;
      var page = "http://www.hotelsbycity.com/hotels/popMTG.php?key="+searchText+"&vcid=43683&headerText="+searchText+" Still looking for deals?&titleText=Still looking for hotel deals in -key-?&showURL=yes";
      var windowprops = "resizable=1,scrollbars=1,menubar=1,location=1,toolbar=1,titlebar=1,width=590,height=505, top=50, left=50";
      newWindow = window.open(page, 'popMTG', windowprops);
      newWindow.blur();
}

function advertiserLightbox(total,selected, urlArray){
	var abc = new Array();
	var rand_no = Math.round(Math.random()* 100);
	var elem = document.getElementById('lightBoxList'); 
	abc.push('<table cellspacing="0" cellpadding="2" border="0">');
	abc.push('<tr><td colspan="2"><h3><u> Your Pop-Up Blocker is On </u></h3></td><td>');
	abc.push('<a href="#" style="position:absolute;" onClick="javascript:hideLightBox();"><p><b>Close</b></p></a>');
	abc.push('</td></tr><tr><td colspan="2" style="border-bottom: 2px solid #FF8600;"><h5> Click each "Check Rates" button to view the sites you selected. </h5>')
	abc.push('</td></tr><tr><td colspan="2" align="center"><p style="font-weight:normal; color:#0A97CC; padding-top:3px;">You have selected '+selected+' out of '+total+' sites </p>');
	abc.push('</td></tr><tr><td colspan="4" align="center"><table cellpadding="0" cellspacing="0" border="0" style="border: 1px solid #DEDEDE;">');
	abc.push('<tr><td colspan="2" style="padding-bottom:5px;"><h6> Compare prices and availability with partners: </h6>');
	abc.push('</td></tr><input type="hidden" id="count" name="count" value="'+(selected-1)+'"/>');
	abc.push('<input type="hidden" id="" name="newwindow" value=""/>');
	for(i=0;i<urlArray.length;i++){
		name =	urlArray[i].substring(0,urlArray[i].indexOf(","));
		url	 =  urlArray[i].substring(urlArray[i].indexOf(",")+1);		
		abc.push('<tr><td align="right" style="padding-bottom:5px; cursor:pointer;"><img id="imgCheckRate'+i+'" src="/objimages/rates_button.jpg" alt="Check Rates" border="0" onClick="advertiserLightBoxPopup(\''+url+'\',\''+i+rand_no+'\',\''+i+'\');">');
		abc.push('</td><td align="left"><p class="site" style="padding-bottom:5px;">&nbsp;'+name);
		abc.push('</p></td></tr>');	
	}	
	abc.push('</table></td></tr></table>');	
	elem.innerHTML =abc.join('');
	if(urlArray.length>1)
		showLightBox();
	advertiserLightBoxPopup(urlArray[0].substring(urlArray[0].indexOf(",")+1),0+rand_no,0);
}

function openVCPopHtl(searchText) {
	  var htlSearch = searchText + ' hotels';
      var page = "http://www.hotelsbycity.com/hotels/popMTG.php?key="+htlSearch+"&vcid=43965&showURL=yes&headerText=Still looking for hotels in "+searchText+"?&titleText="+htlSearch;
      var windowprops = "resizable=1,scrollbars=1,menubar=1,location=1,toolbar=1,titlebar=1,width=590,height=505, top=50, left=50";
      newWindow = window.open(page, 'popMTG', windowprops);
	  newWindow.blur();
}

function openVCPopFlights(searchText) {
	  var fltSearch = searchText + ' flights';
      var page = "http://www.hotelsbycity.com/hotels/popMTG.php?key="+fltSearch+"&vcid=43965&showURL=yes&headerText=Still looking for flights in "+searchText+"?&titleText="+fltSearch;
      var windowprops = "resizable=1,scrollbars=1,menubar=1,location=1,toolbar=1,titlebar=1,width=590,height=505, top=50, left=50";
      newWindow = window.open(page, 'popMTG', windowprops);
	  newWindow.blur();
}

function openVCPopRC(searchText) {
	  var rcSearch = searchText + ' rental cars';
      var page = "http://www.hotelsbycity.com/hotels/popMTG.php?key="+rcSearch+"&vcid=43965&showURL=yes&headerText=Still looking for rental cars in "+searchText +"?&titleText="+rcSearch;
      var windowprops = "resizable=1,scrollbars=1,menubar=1,location=1,toolbar=1,titlebar=1,width=590,height=505, top=50, left=50";
      newWindow = window.open(page, 'popMTG', windowprops);
	  newWindow.blur();
}

function advertiserLightBoxPopup(servletUrl,newWinId,buttonId){
	var slink = servletUrl;	
	for(j=0;j<countWins.length;j++){
		if(countWins[j]==newWinId){	
	 		if(openWins[j] && !openWins[j].closed){
	 			openWins[j].focus();				
	 		}
			return;
	 	}
	}
	if(coachingWindow != null){		
		poptop  = poptop+35;
	}
	countWins[curWinNew]= newWinId;
	openWins[curWinNew] = coachingWindow= window.open(slink,newWinId,'left=300,top='+poptop+',screenX=5,screenY=5,menubar=yes,location=yes,directories=yes,scrollbars=yes,resizable=yes,status=yes,toolbar=yes,outerHeight=600,outerWidth=725,width=725,height=600');
	elementID = 'imgCheckRate'+buttonId;
	document.getElementById(elementID).src="/objimages/rates_button1.gif";
	if(document.lightBoxList.count.value==0){	      
       	hideLightBox(); 
	}else{
		curWinNew++;
       	document.lightBoxList.count.value =document.lightBoxList.count.value-1; 
	}    
}

function checkBoxSelection(name,i){
	if(document.getElementById(name+"-"+i).checked==false){
		  document.getElementById(name+"-"+i).checked=true;
		  document.getElementById("Box-"+i).style.border="1px solid #000000"; 
	} else{
		  document.getElementById(name+"-"+i).checked=false;
		  document.getElementById("Box-"+i).style.border="1px solid #DDDDDD"; 
		}
}
function checkLightBoxSelection(name, hotelId, placementId){
	if(document.getElementById(hotelId+name+"-"+placementId).checked==false){
		 document.getElementById(hotelId+name+"-"+placementId).checked=true;
		 document.getElementById(hotelId+"Box-"+placementId).style.border="1px solid #000000";
			  
	} else{
		  document.getElementById(hotelId+name+"-"+placementId).checked=false;
		  document.getElementById(hotelId+"Box-"+placementId).style.border="1px solid #DDDDDD";
	}
}