// last_update: 02-18-05 (renteria) - CAEA

var http_loc;

// checkpoint (somewhat outdated)
var isDOM = (document.getElementById)?true:false;
var isNS4 = (document.layers)?true:false;
var isIE = (document.all)?true:false;
var isMac = (navigator.appVersion.indexOf("Mac") != -1);
var isOpera = (navigator.userAgent.substr(navigator.userAgent.indexOf("Opera")+6,1)<=6)?true:false;




if (!isIE) {
	document.write('<link rel="styleSheet" href="/includes/css/non_ie.css" type="text/css">');
}
else {
	document.write('<link rel="styleSheet" href="/includes/css/default.css" type="text/css">');
}



// img cache/swap

function cache(imgStr,SRC) {
        	if (document.images) {
                	eval(imgStr+' = new Image()');
                	eval(imgStr+'.src = "'+SRC+'"');
        	}
	}

function swap(imgName,imgObj,layer) {
        	if (document.images) {
                	
                        	document.images[imgName].src = eval(imgObj+".src");
                	}
        	}

 	 DIR="zoomer_yard/";	// img dir		

		cache("show_notes", DIR +"show_notes.gif")
		cache("show_notes_on", DIR + "show_notes_hover.gif")
		cache("audio", DIR +"audio.gif")
		cache("audio_on", DIR + "audio_hover.gif")
		cache("f_screen", DIR +"f_screen.gif")
		cache("f_screen_on", DIR + "f_screen_hover.gif")
		
function alignMenu(http_loc) {
			
		if (http_loc == "VIEWER_PAGE") {
			document.write('<table width="792" border="0" cellpadding="0" cellspacing="0">');
		}
		else {
			document.write('<table width="772" border="0" align="center" cellpadding="0" cellspacing="0">');
		}
}

function scaleMenu(http_loc) {

		if (http_loc == "VIEWER_PAGE") {
				document.write('<td height="50" width="435">&nbsp;');
		} else if (http_loc == "ARCHIVE_PAGE" || "LOOKUP_PAGE") { 	
				document.write('<td height="50" width="396">&nbsp;');
		} else {
				document.write('<!--null-->');
		}

}

function adjustLookup() {
	
	// align search box for gecko
	if (!document.all) { document.write('<br>'); }
		
}

function pushWindow() {
	
	// gecko in fullscreen mode needs to be pushed into place
	if (!document.all) {

	var newX = 0, newY = 0;
	
		//top left, full
    	window.moveTo(newX,newY);  
		window.resizeTo(window.screen.availWidth,window.screen.availHeight);
		//window.resizeTo(1024,768);

	}
}

// triggered by label-click
function showNotes(url) {

if (isIE) {
		window.open(url,'note','height=300,width=435,menubar=0,toolbar=0,scrollbars=1,resizable=1,status=0,titlebar=0');
		this.focus;
	}
	else {
		window.open(url,'note','height=300, width=435, menubar=no, toolbar=no, scrollbars=yes, resizable=yes');
		this.focus;
	}
}

function mediaPop(url,width,height) {

if (isIE) {
		window.open(url,'mpop','height='+height+',width='+width+',menubar=0,toolbar=0,scrollbars=0,resizable=1,status=0,titlebar=0');
		window.focus;
	}
	else {
		window.open(url,'mpop','height='+height+', width='+width+', menubar=no, toolbar=no, scrollbars=no, resizable=yes');
		this.focus;
	}
}

function IE_timerClose () {
	
		intervalID = setTimeout('self.close()',0);
}

function IE_clearFocusTimeouts () {
	
		clicked = true;
		
		clearTimeout(intervalID); 
		document.onclick = pClickListen; 
}

function pClickListen () {
		
		window.focus();
		window.onblur = IE_timerClose;
		
		
}

function killWindow () {
	
		window.close();		
}

function fieldCheck () {
	
	if(document.dsppFind.search.value.length==0) {
		alert("Please enter a search term");
		
		return false;
	}
}
		
//end
		
