// =============================================
// Name: PageScript.js 
// Auth: Paul Konopacki
// Desc: Javascript functions for www.geostl.com
//       site navigation and page layout
// =============================================

// ------------------------------------
// FAVICON
// ------------------------------------
document.write("<LINK REL='SHORTCUT ICON' href='/SLAGA/favicon.ico'>");

// ------------------------------------
// ------------------------------------
// BEGIN FUNCTIONS
// ------------------------------------
// ------------------------------------
function PageScript_WritePageHeader() {
	document.write("<tr><td class='pageheader' colspan=10>");
	PageScript_WriteNavBottomLinks();
	document.write("</td></tr>");

}
// ------------------------------------
function PageScript_WritePageTitle(H1) {
 	document.write("<tr><td colspan=10><table width=100% border=0 cellspacing=0 cellpadding=3><tr><td class='pagetitle'>" + H1 + "</td></tr></table></td></tr>");
}

// ------------------------------------
function PageScript_WritePageTitle2(H1, H2) {
	document.write("<tr><td colspan=10><table width=100% border=0 cellspacing=0 cellpadding=3><tr><td class='pagetitle' width='15%'>&nbsp;</td><td class='pagetitle' width='70%'>" + H1 + "<br><span class='pagetitlesub'>" + H2 + "</span></td><td class='pagetitle' width='15%'>&nbsp;</td></tr></table></td></tr>");
}
// ------------------------------------
function PageScript_WriteNavTop() {

	document.write("<table border='0' cellspacing='0' cellpadding='0' height='100%'><tr><td>");
	PageScript_WriteNavLinks();
	document.write("</td></tr><tr>");	
	document.write("<td width='100%'>");
}

// ------------------------------------
function PageScript_WriteNavBottom() {

	document.write("</td></tr><tr><td class='pagefooter' colspan=10><br><center>");

	PageScript_WriteNavLinks();

	document.write("</center></td></tr></table>");
}
// ------------------------------------
function PageScript_WriteNavLinks() {
    
    document.write("<br><span class='pagefooter'><center><a href='/'>SLAGA Home Page</a></center></span>");

}
// ------------------------------------
function PageScript_OpenWindow(myURL,mySizeType) {

	var strParameters = "";
	var strTarget = ""

    // ----- JUST SO WE DONT FORCE USER TO LOSE THEIR LAST CHAT LOGIN
	if (mySizeType == "CHAT" ) {
	    var dt = new Date();
	    mySizeType = mySizeType + dt.getMinutes();
	}

    strTarget = "NewSLAGA" + mySizeType;


	// -----  CLUDGE.  I.E. DOESN'T HANDLE '&' CORRECTLY; IT ALWAYS WANTS TO INTERPRET IT A SPECIAL URLENCODED CHARACTER
	var detect = navigator.userAgent.toLowerCase();
	place = detect.indexOf('msie') + 1;
	if (place > 0) {
		myURL = myURL.replace('&','%26');
	}


	if (mySizeType == "MODAL") {
		strParameters = "toolbar=no,directories=no,location=no,status=no,menubar=no,resizable=no,scrollbars=yes,width=800,height=600,copyhistory=no";
		myWin = window.open(myURL,target=strTarget,strParameters);
	}
	else {
		myWin = window.open(myURL,target=strTarget);
	}

	myWin.focus();
}
// ------------------------------------
function PageScript_CloseWindow() {
	window.close();
}
// ------------------------------------
