//Mervin Soriano
//FAAIE - 7/05/2004
//Spokane, WA
//==================================================================================
var openWin = "";
//This function will pop up another window to show another page.  
//Requires 3 parameters, the relative source, the window wudth, and window height
function newWin(pageSrc, mWidth, mHeight) {
	
	/**if the browser supports the screen object, manipulate the position of
	the window to show in the center of the screen **/
	if(screen) {
		leftPos = ((screen.width / 2) - (mWidth/ 2));
		topPos = ((screen.height / 2) - (mHeight / 2));
	}//end if
	
	openWin = window.open(pageSrc, "newWindow", "scrollbars=yes, toolbar=no, menubar=no, width="+mWidth+", height="+mHeight+", left="+leftPos+", top="+topPos+"");
	//openWin.focus();
	
	//if (openWin.opener == null) openWin.opener = self;

}//end newWin

function faaieGallery(xmlSrc, picSrc){
	newWin('gallery/faaie_gallery.html',660, 480);
	openWin.document.getElementById("myFlash").SetVariable("myXMLSrc", xmlSrc);
	openWin.document.getElementById("myFlash").SetVariable("myPicSrc", picSrc);
}

//===========================================================
function closeWin() {
	if(openWin && !openWin.closed) {
		openWin.close();
	}//end close
}//end closeWin

//===========================================================
function changeTab() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

//===========================================================
function pstClock(){
/*www.a1javascripts.com*/
    myTime = new Date();
    gmtMS = myTime.getTime() + (myTime.getTimezoneOffset() * 60000);
    gmtTime =  new Date(gmtMS);
    pHour = (gmtTime.getHours() + 8) % 24; //PST is 8 hours ahead of GMT, mod 24 to display the 12 hour time
	var pAmPm = ((pHour < 12) ? "AM" : "PM");
    pMinute = gmtTime.getMinutes();
    pSecond = gmtTime.getSeconds();
    pHour = ((pHour == 0) ? 12 : pHour);
	pHour = ((pHour <= 12) ? pHour : pHour - 12);
    temp = "" + pHour;
    temp += ((pMinute < 10) ? ":0" : ":") + pMinute;
    temp += ((pSecond < 10) ? ":0" : ":") + pSecond;
	temp += " " + pAmPm;
    document.clockForm.pstClock.value = temp;
    setTimeout("pstClock()",1000);
}
//============================================================
function getPDate(){
	
	today = new Date();
	timezoneoffset = today.getTimezoneOffset();
	today.setTime(today.getTime() + 8 * 60 * 60 * 1000);
	date = today.getDate();
	day = today.getDay(); 
	month = today.getMonth();
	year = today.getYear();    
	
	switch (day) {
		case 0 : day = "Sunday"; break;
		case 1 : day = "Monday"; break;
		case 2 : day = "Tuesday"; break;
		case 3 : day = "Wednesday"; break;
		case 4 : day = "Thursday"; break;
		case 5 : day = "Friday"; break;
		default : day = "Saturday"; break;
	}//end switch(day)
	
	switch (month) {
		case 0 : month = "January"; break;
		case 1 : month = "February"; break;
		case 2 : month = "March"; break;
        case 3 : month = "April"; break;
		case 4 : month = "May"; break;
		case 5 : month = "June"; break;
		case 6 : month = "July"; break;
		case 7 : month = "August"; break;
	    case 8 : month = "September"; break;
		case 9 : month = "October"; break;
		case 10 : month = "November"; break;
		default : month = "December"; break;
   	}//end switch(month)

	document.write ("<font size=-2 face='Arial, Helvetica, sans-serif' color=000000> "+ day + ", " + month + " " + date + ", " + year + "</font>")
}