//FUNCTION TO OPEN A NEW BROWSER WINDOW
function openWin(url,winname,w,h,scrollbars) {
        topWin = (screen.availHeight - h) / 2;
        leftWin = (screen.availWidth - w) / 2;
		if(scrollbars){
			var scroll = scrollbars;
		}else{
			var scroll = 'yes';
		}
		
                if (navigator.platform.indexOf('mac') != -1){
                	props = "menubar=yes,width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizabe=yes,scrollbars="+scroll+""; 
				}
                else {
                	props = "width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,scrollbars="+scroll+""; 
				}
        var myWin = window.open(url,winname,props);
        myWin.focus();
}

//FUNCTION TO OPEN A URL IN NEW BROWSER WINDOW
function openURL(url,winname,w,h) { 
	topWin = (screen.availHeight - h) / 2;
	leftWin = (screen.availWidth - w) / 2;
		if (navigator.platform.indexOf('mac') != -1){
	 	props = "menubar=yes,width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,scrollbars=no"; }
		else {
		props = "width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes,scrollbars=no"; }
	var myWin = window.open(url,winname,props);
	myWin.focus();
}

//FUNCTION TO RESIZE IMAGE POPUPS
function enlargeImg(url,winname,w,h) { 
	self.resizeTo(w,h);
	self.location = url;
}



//FUNCTION TO OPEN MULTIMEDIA TOOL
function multiTool(url) {
	w=1;
	h=1;
	topWin = (screen.availHeight - h) / 2;
	leftWin = (screen.availWidth - w) / 2;
		if (navigator.platform.indexOf('mac') != -1){
	 	props = "menubar=yes,width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes"; }
		else {
		props = "width="+w+",height="+h+",top="+topWin+",screenY="+topWin+",left="+leftWin+",screenX="+leftWin+",resizable=yes"; }
	var myWin = window.open(url,"toolMediate",props);
	myWin.focus();
}

//FUNCTION TO PRINT PAGE	
function printit() {
	if (window.print) window.print();
	else {
		if (navigator.platform.indexOf('Mac') != -1)alert('This function does not work in your browser! \n Please select the Print option from the File menu.');
		else if (navigator.platform.indexOf('Win') != -1)alert('This function does not work in your browser! \n Please right click on your mouse and select the Print option.');
		else alert('This function does not work in your browser!');
	}
}
// END FUNCTION TO PRINT PAGE

//BEGIN STYLEWRITER
if(navigator.userAgent.indexOf("MSIE 4.5") != -1){
        document.write('<link rel="stylesheet" href="' + relativeRoot + 'css/mac_ns.css">');
}
else if(navigator.userAgent.indexOf("IE") != -1){
        document.write('<link rel="stylesheet" href="' + relativeRoot + 'css/ie.css">');
}
else if(navigator.userAgent.indexOf("Mozilla/5") != -1){
        document.write('<link rel="stylesheet" href="' + relativeRoot + 'css/ie.css">');
}
else if(navigator.userAgent.indexOf("Mac") != -1 && navigator.appName.indexOf("Netscape") != -1){
        document.write('<link rel="stylesheet" href="' + relativeRoot + 'css/mac_ns.css">');
}
else if(navigator.userAgent.indexOf("Mac") != -1){
        document.write('<link rel="stylesheet" href="' + relativeRoot + 'css/ie.css">');
}
else{
        document.write('<link rel="stylesheet" href="' + relativeRoot + 'css/ns.css">')
}
//END STYLEWRITER

