// Break Out of Frames
if (top.frames.length!=0) {top.location=self.document.location;}

//var whichMnu;
//var imgBase="http://seattlecentral.edu/img/";

// Netscape Resize Fix
NS4 = document.layers;
if (NS4) {origWidth = innerWidth; origHeight = innerHeight;}
function reDo() {if (innerWidth != origWidth || innerHeight != origHeight) location.reload();}
if (NS4) onresize = reDo;

//variables for mediaplayer 
    var UniqueID = 314 // Make each link open in a new window
    var newWinOffset = 0 // Position of first pop-up
	
function swtch(num, imgname) {document[imgname].src = img[num].src;}
function hilite(imgsrc, imgname) {document[imgname].src = imgsrc;}
function newWin(addr,w,h) {
	if (!w) { w=800; }
	if (!h) { h = 600; }
	win = window.open(addr, 'win', 'resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,left=0,top=0,width='+w+',height='+h);
	win.focus
}
function FirstGenWin(url,w,h)
	{
		win = window.open(url, 'win', 'resizable=no,scrollbars=auto,toolbar=no,menubar=no,left=320,top=240,width='+w+',height='+h);
		win.focus
	}
function newWinFixed(addr,w,h) {win = window.open(addr, 'win', 'resizable=no,scrollbars=no,toolbar=no,menubar=no,left=320,top=240,width='+w+',height='+h);win.focus}
function sosWin(whichApp){
	// Values for whichApp
	//SID, GRADE, SCHDPLAN, REG, YOURSCHD, QTRSCHD, REGAPPT, AA, FAID, HOPE, PIN, ADDR
	var seacen = "https://sccdweb.sccd.ctc.edu/seacen/";
	var addr;
	if (whichApp == 'SID'){addr = seacen + "waci240.html";}
	else if (whichApp == 'GRADE') {addr = seacen + "waci002.html";}
	else if (whichApp == 'SCHDPLAN') {addr = seacen + "schdplan/waci210Base.html";}
	else if (whichApp == 'REG') {addr = seacen + "webreg/waci221.html";}
	else if (whichApp == 'YOURSCHD') {addr = seacen + "waci003.html";}
	else if (whichApp == 'REGAPPT') {addr = seacen + "waci004.html";}
	//else if (whichApp == 'AA') {addr = seacen + "waci007.html";}
	else if (whichApp == 'AA') {addr = "https://www.public.ctc.edu/DAStudentWeb/Login.aspx?col=062";}
	else if (whichApp == 'FAID') {addr = seacen + "waci005.html";}
	else if (whichApp == 'HOPE') {addr = "https://sccdweb.sccd.ctc.edu/seacen/hope/hope_active.html";}
	else if (whichApp == 'PIN') {addr = seacen + "waci008.html";}
	else if (whichApp == 'ADDR') {addr = seacen + "stuaddr/waci203.html";}
	//else if (whichApp == 'PAY') {addr = seacen + "webxfer/waci600.html";}
	//else if (whichApp == 'PAY') {addr = seacen + "webreg/waci221.html";}
	else if (whichApp == 'PAY') {addr = seacen + "webxfer/waci600.html";}
	else if (whichApp == 'TUT') {addr = "http://sccdweb.sccd.ctc.edu/seacen/register.html";}
	else if (whichApp == 'HELP') {addr = "https://sccdweb.sccd.ctc.edu/seacen/help.html";}
	else if (whichApp == 'WAIT') {addr = seacen + "webreg/waci230.html";}
	
	win = window.open(addr, 'win', 'resizable=yes,scrollbars=yes,toolbar=yes,menubar=yes,left=0,top=0,width=630,height=380');
	win.focus();
}

function mailw() {
		var d="sccd.ctc.edu";var n="scccwebmaster";var e=n + "@" + d;var atxt=" Contact the Webmaster ";
		document.write("<a href='mailto:"+e+"'>"+atxt+"</a>");
}


function toggleDiv(elemID) { 
	var x = document.getElementById(elemID); 
	if (x.style.display == 'none') {
			x.style.display = 'block';
	} else {
			x.style.display = 'none';
	}
} 


function ToggleFormDiv(elemID) { 
	var x = document.getElementById(elemID); 
	if (x.style.visibility == 'hidden') {
			x.style.visibility = 'visible';
	} else {
			x.style.visibility = 'hidden';
	}
} 

// Helpdesk Req Form
 function ResetVals(keepMyVal) {
	     //var arUserVals = new Array("UserName", "RequestID", "CSNum", "DisplayRequests");
		var arUserVals = new Array("UserName", "RequestID", "DisplayRequests");
        for ( var i = 0; i < arUserVals.length; i++ ) {
            if ( arUserVals[i] != keepMyVal ) {
				//alert( arUserVals[i]);
                document.GetRequests[arUserVals[i]].value = '';
            }
        }
    }
	
function PlayerOpen(soundfiledesc,soundfilepath) {
    PlayWin = window.open('',UniqueID,'width=320,height=190,top=' + newWinOffset +',left=0,resizable=0,scrollbars=0,titlebar=0,toolbar=0,menubar=0,status=0,directories=0,personalbar=0');
    PlayWin.focus();

    var winContent = "<HTML><HEAD><TITLE>" + soundfiledesc + "</TITLE></HEAD><BODY bgcolor='#ffffff'>";
    winContent += "<B style='font-size:16px;font-family:Verdana,sans-serif;line-height:1.5'>" + soundfiledesc + "</B>";

    winContent += "<OBJECT width='300' height='42'>";
    winContent += "<param name='SRC' value='" + soundfilepath + "'>";
    winContent += "<param name='AUTOPLAY' VALUE='true'>";
    winContent += "<param name='CONTROLLER' VALUE='true'>";
    winContent += "<param name='BGCOLOR' VALUE='#ffffff'>";
    winContent += "<EMBED SRC='" + soundfilepath + "' AUTOSTART='TRUE' LOOP='FALSE' WIDTH='300' HEIGHT='42' CONTROLLER='TRUE' BGCOLOR='#ffffff'></EMBED>";
    winContent += "</OBJECT>";

    winContent += "<p style='font-size:12px;font-family:Verdana,sans-serif;text-align:center'><a href='" + soundfilepath +"'>Download this file</a> <SPAN style='font-size:10px'>(right-click or Option-click)</SPAN></p>";
    winContent += "<FORM><DIV align='center'><INPUT type='button' value='Close this window' onclick='javascript:window.close();'></DIV></FORM>";
    winContent += "</BODY></HTML>";

    PlayWin.document.write(winContent);
    PlayWin.document.close(); // "Finalizes" new window
    UniqueID = UniqueID + 1 // newWinOffset = newWinOffset + 20 // subsequent pop-ups will be this many pixels lower
}

function installThin() {
    var x = navigator;
    var arVer = x.appVersion.split("MSIE");
    var ieVer = parseInt(arVer[1]);

	if (x.appName.toLowerCase() == "microsoft internet explorer" && ieVer >= 5) {
	  
	    document.getElementById("thin").innerHTML = "Your browser is Internet Explorer 5.0 or higher and able to use thin client. <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=e2ff8fb5-97ff-47bc-bacc-92283b52b310&DisplayLang=en\" target=\"_blank\">Click to install Microsoft Thin Client Plug-In</a>";
	}
	else {	  
	   //debug 
	   //alert ("Full String = " + x.appVersion + "<br /> app Name (lower) = " + x.appName.toLowerCase() + "<br />IE Version = " + ieVer.toString());

	   if (!(x.appName.toLowerCase() == "microsoft internet explorer")) {
	       document.getElementById("thin").innerHTML = "<p><b>You are using a version of " + x.appName.toString() + " for a web browser!</b></p><p>In order to use this plug-in, you must be using Internet Explorer 5 or above. <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=1E1550CB-5E5D-48F5-B02B-20B602228DE6&displaylang=en\" target=\"_blank\">Click to install Internet Explorer 6.0</a>.</p>";
	   }
	   else {
	       document.getElementById("thin").innerHTML = "<p><b>Your Internet Explorer web browser is out of date!</b></p><p>In order to use this plug-in, you must be using Internet Explorer 5 or above. <a href=\"http://www.microsoft.com/downloads/details.aspx?FamilyID=1E1550CB-5E5D-48F5-B02B-20B602228DE6&displaylang=en\" target=\"_blank\">Install Internet Explorer 6.0</a></p>";
	   }
	}
}
