function open_popup(url, w, h, resize, scroll) {
/* place this in onclick or href:  "javascript:open_popup([url],[width of window],[height of window],[resize option],[scroll opiton]);"  */
  var properties = "toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0,width="+ w +",height="+ h;
  if((scroll==0)||(scroll==1)){  properties+=",scrollbars="+ scroll; }
  if((resize==0)||(resize==1)){  properties+=",resizable="+ resize; } 	
  child = window.open(url,"popup", properties);
  child.focus();
}

function getDayString(num) {
	var day;
	var days = new Array ("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
  	day = ((num >= 0) || (num < 7)) ? days[num] : "Invalid Day";
	return day;
}

function getMonthString(num) {
	var month;
	var months = new Array ("Jan", "Feb", "Mar", "Apr", "May", "June", "July", "Aug", "Sept", "Oct", "Nov","Dec");

  	month = ((num >= 0) || (num < 12)) ? months[num] : "Invalid Month";
	return month;
}

theDate = new Date();


function gotoSite(site) {
	if  (site != "") {
		window.parent.opener.location=site;
	}
	window.parent.opener.focus();
	window.close();
}


//ROLLOVERS

function swap(img,isrc) {
   if (!document.images) return;
   document.images[img].src = isrc;
}


//INPUT BUTTON ROLLOVERS
/* <input hoversrc="[image]"> */

var MWJ_img_cache = new Object();
for( var i = 0; i < 2; i++ ) {
	var ar = i ? ( document.getElementsByTagName ? document.getElementsByTagName('input') : ( document.all ? document.all.tags('INPUT') : [] ) ) : document.images;
	for( var x = 0; ar[x]; x++ ) {
		var im = ar[x];
		if( im.getAttribute ) { im.hoversrc = im.getAttribute('hoversrc'); im.activesrc = im.getAttribute('activesrc'); }
		if( im.hoversrc || im.activesrc ) {
			if( !MWJ_img_cache[im.src] ) { MWJ_img_cache[im.src] = new Image(); MWJ_img_cache[im.src].src = im.src; }
			im.rootsrc = im.src;
			im.onmouseout = function () { this.src = this.rootsrc; };
		}
		if( im.hoversrc ) {
			if( !MWJ_img_cache[im.hoversrc] ) { MWJ_img_cache[im.hoversrc] = new Image(); MWJ_img_cache[im.hoversrc].src = im.hoversrc; }
			im.onmouseover = function () { this.src = this.hoversrc; };
		}
		if( im.activesrc ) {
			if( !MWJ_img_cache[im.activesrc] ) { MWJ_img_cache[im.activesrc] = new Image(); MWJ_img_cache[im.activesrc].src = im.activesrc; }
			im.onmousedown = function (e) {
				e = e ? e : window.event;
				if( e.button > 1 || e.which > 1 ) { return; }
				this.src = this.activesrc;
			};
			im.onmouseup = function (e) {
				e = e ? e : window.event;
				if( e.button > 1 || e.which > 1 ) { return; }
				this.src = this.hoversrc ? this.hoversrc : this.rootsrc;
			};
		}
	}
}



//DYNAMIC PULL-DOWN
/* <form><select name="mySelect" onChange="goSelect(this);">[options]</select>[submit]</form>*/

function goSelect(thisselect){
	if (thisselect.selectedIndex > 0){
		var url = thisselect.options[thisselect.selectedIndex].value;
		if (url != '') window.location = url;
	}
}


// SLIDESHOW
/* Put this code in the page:
<a href="#" onClick="toggle('div1',1); toggle('div2',0); toggle('div3',0); return false;"><img src="image" border="0"></a>*/

function toggle(id,fff) {
if (fff=="1"){
if (document.layers) document.layers[''+id+''].visibility = "show"
else if (document.all) document.all[''+id+''].style.visibility = "visible"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "visible"
}
else
if (fff=="0"){
if (document.layers) document.layers[''+id+''].visibility = "hide"
else if (document.all) document.all[''+id+''].style.visibility = "hidden"
else if (document.getElementById) document.getElementById(''+id+'').style.visibility = "hidden"
}
}

function correctPNG() 
   {
   for(var i=0; i<document.images.length; i++)
      {
          var img = document.images[i]
          var imgName = img.src.toUpperCase()
          if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
             {
                var imgID = (img.id) ? "id='" + img.id + "' " : ""
                var imgClass = (img.className) ? "class='" + img.className + "' " : ""
                var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' "
                var imgStyle = "display:inline-block;" + img.style.cssText 
                if (img.align == "left") imgStyle = "float:left;" + imgStyle
                if (img.align == "right") imgStyle = "float:right;" + imgStyle
                if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle           
                var strNewHTML = "<span " + imgID + imgClass + imgTitle
                + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
             + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
                + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>" 
                img.outerHTML = strNewHTML
                i = i-1
             }
      }
   }