/*********************************************************************
// resCheck() is used to jump down to a specified anchor link if 
// the user's browser is too small to display the main nav links. 
// Used in the front page for each room. (by: Trevor Tan)
*********************************************************************/
function resCheck() {
  if ((window.screen.availHeight < 750) && (window.location.href.indexOf('#fix')==-1)) {
	var myurl = window.location.href + '#fix';
	window.location = myurl;
  }
}

/*********************************************************************
// OPEN BROSWERS ECARDS
*********************************************************************/

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


/*********************************************************************
// CHANGE
// Finds an element (by ID) and changes its CSS class.
*********************************************************************/
function change(id, newClass) {
	identity=document.getElementById(id);
	if (identity.className != newClass) {
	  identity.className=newClass;
	}
}



/*********************************************************************
// PRELOAD IMAGES
*********************************************************************/ 
function preload_starimages() {
	MM_preloadImages('/common/images/nav-home-roll.gif','/common/images/nav-intro-roll.gif','/common/images/nav-exhibit-roll.gif','/common/images/nav-museinfo-roll.gif','/common/images/nav-ticket-roll.gif','/common/images/nav-galaxy-roll.gif','/common/images/nav-extra-roll.gif','/common/images/nav-about-roll.gif','/common/images/sub-intro-welcome-roll.gif','/common/images/sub-intro-acknowledge-roll.gif','/common/images/sub-intro-designer-roll.gif','/common/images/sub-exhibit-photos-r.gif','/common/images/sub-exhibit-detail-r.gif','/common/images/sub-museum-mission-roll.gif','/common/images/sub-museum-contact-roll.gif','/common/images/sub-museum-directions-roll.gif','/common/images/sub-museum-traransport-roll.gif','/common/images/sub-extra-downloads-roll.gif','/common/images/sub-extra-ecards-roll.gif','/common/images/sub-extra-links-roll.gif')

}


/*********************************************************************
// ROLLOVER NAV
*********************************************************************/

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) { //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];}
}

/*********************************************************************
// WebTrends code revised by Bradford Mar
*********************************************************************/

function dcs_6_0(dcs_URI,dcs_QRY,dcs_EXT)
{
    var recording=(document.WTrepress)?false:true;//recording is always on, but can be turned off by adding WTrepress to the document
	var dCurrent = new Date();
	var P = "";
	P+="http"+(window.location.protocol.indexOf('https:')==0?'s':'')+"://206.135.17.133/content/dcs.gif?";
	P+="dcsuri="+escape(dcs_URI);
	P+="&dcsqry="+escape(dcs_QRY);
	if ((window.document.referrer != "") && (window.document.referrer != "-"))
	{
		if (!(navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) < 4) )
		{
			P+="&dcsref="+escape(window.document.referrer);
		}
	}
	P+=dcs_EXT;
	P+="&dcssip=starwars.fidm.edu";  //For Cross domain tracking, replace 'yourdomain' and remove the leading '//'.
	//P+="&dcsp3p=yourp3pheader";  //To issue P3P header, replace 'yourp3pheader' and remove the leading '//'.
	//P+="&dcscfg=yourcfg";  //To configure SDC, replace 'yourcfg' and remove the leading '//'.
	P+="&dcsdat="+escape(dCurrent.getTime());
	if (recording) MM_preloadImages(P+"");//preload image only if recording is true
}
function dcsExtend(N,V)
{
	dcsEXT+="&"+N+"="+escape(V);
}
function dcsMeta() 
{
	var F=false;
	var myDocumentElements;
	if (document.all)
	{
		F = true;
		myDocumentElements=document.all.tags("meta");
	}
	if (!F && document.documentElement)
	{
		F = true;    
		myDocumentElements=document.getElementsByTagName("meta");
	}
	if (F)
	{
		for (var i=1; i<=myDocumentElements.length;i++)
		{
			myMeta=myDocumentElements.item(i-1);
			if (myMeta.name.indexOf('WT.')==0)
				dcsExtend(myMeta.name,myMeta.content);
		}
	}	
}

var dcsURI=window.location.pathname;
var dcsQRY=window.location.search;
var dcsEXT="";
dcsMeta();
dcs_6_0(dcsURI,dcsQRY,dcsEXT);