/*
 * Hide e-mail from bots
 *
 * Usage: <script type="text/javascript">print_mail_to_link('info');</script>
 */
var rhs1 = "some-domain";
var rhs2 = ".com";

function print_mail_to_link( lhs ) 
{
   document.write("<a href=\"mailto");
   document.write(":" + lhs + "@");
   document.write(rhs1 + rhs2 + "\">" + lhs + "@" + rhs1 + rhs2 + "<\/a>");
}



/*
 * pops up centered window
 *
 * link example:	<a href="page.html" onClick="pop_win('page.html','','450', '250','resizable=yes,scrollbars=yes,status=yes,toolbar=no,menubar=no');return false;">
 * settings example: 'resizable=yes,scrollbars=yes,toolbar=yes,status=yes,menubar,location,directories'
 */
var win = null;
function pop_win( mypage, myname, w, h, features )
{
	var winl = (screen.width-w)/2;
	var wint = (screen.height-h)/2;
	
	if (winl < 0)
		winl = 0;
	
	if (wint < 0)
		wint = 0;
	
	var settings = 'height=' + h + ',';
	settings += 'width=' + w + ',';
	settings += 'top=' + wint + ',';
	settings += 'left=' + winl + ',';
	settings += features;

	win = window.open( mypage, myname, settings );
	win.window.focus();
}


// as suggested in: http://www.adobe.com/devnet/activecontent/articles/devletter.html
// example:	<script type="text/javascript">print_flash("160","399","/upload/aspectai/flash/home_animation.swf","");</script>
function print_flash(width,height,fileName,noembed)
{
   document.write('<object style="position:relative;z-index:5;" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="'+height+'" width="'+width+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">\n');
   document.write('<param value="'+fileName+'" name="Movie" />\n');
   document.write('<param value="'+fileName+'" name="Src" />\n');
   document.write('<param value="transparent" name="WMode" />\n');
   document.write('<param value="-1" name="Play" />\n');
   document.write('<param value="-1" name="Loop" />\n');
   document.write('<param value="High" name="Quality" />\n');
   document.write('<param value="-1" name="Menu" />\n');
   document.write('<param value="always" name="AllowScriptAccess" />\n');
   document.write('<param value="ShowAll" name="Scale" />\n');
   document.write('<param value="0" name="DeviceFont" />\n');
   document.write('<param value="0" name="EmbedMovie" />\n');
   document.write('<param value="#ffffff" name="BGColor" />\n');
   document.write('<param value="1" name="SeamlessTabbing" />\n');
   document.write('<param value="0" name="Profile" />\n');
   document.write('<param value="0" name="ProfilePort" /><embed src="'+fileName+'" wmode="transparent" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"><noembed>'+noembed+'</noembed></embed></object>\n');
}


function MM_swapImgRestore() { //v3.0
	var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
	var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
	var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_findObj(n, d) { //v4.01
	var p,i,x;  if(!d) d=document;
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
		d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
	var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


function searchClick()  
{
	var sQuery, sBegDate, sEndDate, sDate;
	if (document.getElementById('specialty').value != "" || document.getElementById('date').value != "" || document.getElementById('keyword').value.length >= 3) 
	{
		sQuery = "market=8&ptype=10&";
		if (document.getElementById('specialty').value != "")
		{
			sQuery = sQuery + "pid=" + document.getElementById('specialty').value;
		}
		else if (document.getElementById('date').value != "")
		{
			sDate = document.getElementById('date').value;
			sBegDate = "01" + sDate.substring(0, sDate.indexOf('-'));
			sEndDate = sDate.substring(sDate.indexOf('-') + 1) + sDate.substring(0, sDate.indexOf('-'));
			sQuery = sQuery + "begdate=" + sBegDate + "&enddate=" + sEndDate;
		}
		else if (document.getElementById('keyword').value != "")
		{
			sQuery = sQuery + "keyword=" + document.getElementById('keyword').value;
		}
//		window.location.replace("http://www.registrationbox.com/tts/res/tour_search_results.asp?" + sQuery);
		window.location.replace = (__utmLinker('http://www.registrationbox.com/tts/res/tour_search_results.asp?'+sQuery));
	}
}

