function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_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_findObj(n, d) { //v3.0
  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); 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 cityOrCounty()
{
	cityCounty = document.form1.CITYCOUNTY.options[document.form1.CITYCOUNTY.selectedIndex].value;
	if(cityCounty != "")
	{
		comma = cityCounty.indexOf(",");
		which = cityCounty.substring(0, comma);
		name = cityCounty.substring(comma+1);
		if(which == "city")
		{
			document.form1.CITY.value = name;
			document.form1.COUNTY.value = "";
		}
		else if(which == "county")
		{
			document.form1.CITY.value = "";
			document.form1.COUNTY.value = name;
		}
	}
}

function dateCheck()
{
	if (document.form1.FROMDATE_MONTH.value == "00" && 
		document.form1.FROMDATE_DAY.value == "00" && 
		document.form1.FROMDATE_YEAR.value == "0000" && 
		document.form1.TODATE_MONTH.value == "00" && 
		document.form1.TODATE_DAY.value == "00" && 
		document.form1.TODATE_YEAR.value == "0000")
	{
		document.form1.DateOption.checked = true;
	}
	else
	{
		document.form1.DateOption.checked = false;
	}
}

function checkCheck()
{
	if(document.form1.DateOption.checked)
	{
		document.form1.FROMDATE_MONTH.selectedIndex = 0; 
		document.form1.FROMDATE_DAY.selectedIndex = 0;
		document.form1.FROMDATE_YEAR.selectedIndex = 0;
		document.form1.TODATE_MONTH.selectedIndex = 0;
		document.form1.TODATE_DAY.selectedIndex = 0;
		document.form1.TODATE_YEAR.selectedIndex = 0;
	}		
}

function mapJump(locID)
{
        document.form1.CITYCOUNTY.selectedIndex = 0;
	document.form1.LOCID.value = locID;
	document.form1.submit();
}

function advancedJump(formName)
{
	for(i=0;i<document.forms.length;i++)
	{
		if(document.forms[i].name == formName) 
		{		
			document.forms[i].action = "servlet/internet.AdvancedSearch";
			document.forms[i].submit();
		}
	}
}

function destJump(city, county, parentIntCatId)
{
	document.form2.action = "/d2k/servlet/internet.StaticSearch";
        document.form2.CITY.value = city;
	document.form2.COUNTY.value = county;
        if(parentIntCatId.length > 0) { 
                document.form2.PARENTINTCATID.value = parentIntCatId;
        }
	document.form2.submit();
}

function destDetailsJump(tid, name)
{
	document.form2.action = "/d2k/servlet/internet.Details";
	document.form2.RSID.value = tid;
	document.form2.NAME.value = name;
	document.form2.submit();
}

function openBrWindow(fileName,title,strSize,strSeason) { //v9Z.0

	 if (strSize=="large") {
	 	intWidth=640;
	    intHeight=520;
		strLink="/activity/template_qtvr_large.htm?Link=/media/" + strSeason + "/480x360/" +  fileName + '.mov' +  "&" + "Title=" + title;
		} 
	if (strSize=="small") {
		intWidth=600;
	    intHeight=380;
		strLink="/activity/template_qtvr_small.htm?Link=/media/" + strSeason + '/320x240/' +  fileName + '.mov' +  "&" + "Title=" + title;
		}
  		features= "width=" + intWidth + ",height=" + intHeight;
	 window.open(strLink,fileName,features);
  
}
