// JavaScript Document

// Date functions
function GetMonth(nMonth) {
	var Months = new Array("January","February","March","April","May","June",
	                       "July","August","September","October","November","December");
	return Months[nMonth] 	  	 
}

function GetDay(nDay) {
	var Days = new Array("Sunday","Monday","Tuesday","Wednesday",
	                     "Thursday","Friday","Saturday");
	return Days[nDay]
}

function dateString() {
	var Today = new Date();
	var suffix = "th";
	switch (Today.getDate())
	{
		case 1:
		case 21:
		case 31: 
			suffix = "st"; break;
		case 2:
		case 22:
			suffix = "nd"; break;
		case 3:
		case 23:
			suffix = "rd"; break;
	};

	var strDate = GetDay(Today.getDay()) + ", " + GetMonth(Today.getMonth()) +  " " + Today.getDate() + ", " + Today.getFullYear();	return strDate
}
function yearString(publishedYear){
	var Today = new Date();
	var strYear = Today.getFullYear();           
	if (!publishedYear) {
				publishedYear = strYear;
	}
	if (strYear == publishedYear) {
				return strYear
	} else {
		strObject = publishedYear + "-" + strYear;
		return strObject;
	}           
}

//Call flash using Javascript
function putFlash(src, width, height, FlashVars) {
    var strObject = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" "
                  + "        codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" "
                  + "        width=\"" + width + "\" height=\"" + height + "\">"
                  + "    <param name=\"movie\" value=\"" + src + "\" /> "
                  + "    <param name=\"quality\" value=\"high\" /> ";

    if (FlashVars && FlashVars != "") {
        strObject += "<param name=\"FlashVars\" value=\"" + FlashVars + "\" /> ";
    }

    strObject += "<embed src=\"" + src + "\" quality=\"high\" "
                  + "           pluginspage=\"http://www.macromedia.com/go/getflashplayer\" "
                  + "           type=\"application/x-shockwave-flash\" ";

	if (FlashVars && FlashVars != "") {
		strObject += "FlashVars=\"" + FlashVars + "\" ";
	}
	
	strObject += "width=\"" + width + "\" height=\"" + height + "\">"
               + "    </embed>"
               + "</object>";

    document.write(strObject);
}

function putFlashHeader() {
    putFlash("flash/header2.swf", 700, 217);
}


function openWindow(url,w,h,shortcut){
	if ( shortcut )
	{
		url += "?shortcut=" + shortcut + "&";
		newWindow=window.open(url,'thewindow','width=' + w + ',height=' + h);  newWindow.focus();
	} else {
		newWindow=window.open(url,'_blank','width=' + w + ',height=' + h);  newWindow.focus();
	}
}

function ResetForm(which){
	var pass=true
	var first=-1
	if (document.images){
	for (i=0;i<which.length;i++){
	var tempobj=which.elements[i]
 	if (tempobj.type=="text"){
  	eval(tempobj.value="")
 	if (first==-1) {first=i}
 	}
 		else if (tempobj.type=="checkbox") {
  		eval(tempobj.checked=0)
  		if (first==-1) {first=i}
 	}
 		else if (tempobj.col!="") {
  		eval(tempobj.value="")
  		if (first==-1) {first=i}
 	}
}
}
which.elements[first].focus()
return false
}
