
// If the platform is Macintosh, use the Macintosh style sheet.
if (navigator.userAgent.indexOf('Mac') == -1 ||
   navigator.userAgent.indexOf('MSIE 5') != -1)
{
 // Windows or MSIE 5
 document.write('<LINK REL=STYLESHEET TYPE="text/css" HREF="/global/css/main_pc.css">');
}
else
{
 // Mac, not MSIE 5
 document.write('<LINK REL=STYLESHEET TYPE="text/css" HREF="/global/css/main_mac.css">');
}

// Variables for a javascript sniffer for the search box sizes.

ie = navigator.userAgent.indexOf('MSIE');
mac = navigator.userAgent.indexOf('Mac');
macosx = navigator.userAgent.indexOf('5.2');
netscape6 = navigator.userAgent.indexOf('Netscape6');
netscape7 = navigator.userAgent.indexOf('Netscape/7');

//Pop-up window for GRI Digital Resources links to Encompass database

function ViewFullRecord(url,name) {
    window.open("" + url,name,'toolbar=0,menubar=0,scrollbars=1,resizable=1,location=0,width=700,innerWidth=700,height=500,innerHeight=500,top=30,left=30');
}

//Pop-up window in Calendar

function popstatic( call ) {
	props = 'dependent=yes,resizable=no,menubars=no,scrollbars=yes,width=550,height=580,left=100,top=100,titlebar=no';
	top.newWin = window.open( call, "Popup", props );
	top.newWin.focus();
}

function popvilla( call ) {
	props = 'dependent=yes,resizable=no,menubars=no,scrollbars=yes,width=782,height=615,left=70,top=70,titlebar=yes,status=yes';
	top.newWin = window.open( call, "Popup", props );
	top.newWin.focus();
}

function popOpenTable( call ) {
	props = 'dependent=yes,resizable=no,menubars=no,scrollbars=yes,width=765,height=615,left=70,top=70,titlebar=yes,status=yes';
	top.newWin = window.open( call, "Popup", props );
	top.newWin.focus();
}


function popsurvey( call ) {
	props = 'dependent=yes,resizable=yes,menubars=no,scrollbars=yes,width=800,innerWidth=800,height=700,innerHeight=700,left=70,top=70,titlebar=yes,status=yes';
	top.newWin = window.open( call, "Popup", props );
	top.newWin.focus();
}

//Google Analytics code; submit tracking info for docs, pdfs, etc. opened in hrefs
function globalMouseUpHandler(e) {
var targ_str = e? new String(e.target): new String(window.event.srcElement);
var ext_str = targ_str.substr((targ_str.length - 4), 4);
ext_str = ext_str.toLowerCase();
if (ext_str == '.doc' || ext_str == '.pdf' || ext_str == '.xls') {
	if (pageTracker) {
		pageTracker._trackPageview(targ_str);
		}
	}
}

document.onmouseup = globalMouseUpHandler;
if (document.layers)
document.captureEvents(Event.MOUSEUP); 	
 //Google Analytics code, end