// JavaScript Document

function menuroll(imgName, imgSrc) {
     document.images[imgName].src = imgSrc;
}

function NewWindow(mypage, myname, w, h, scroll) {
	// ADD TO <A> TAG:  onClick="NewWindow(this.href,'pop','750','550','no');return false;"
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+''
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) {
		win.window.focus();
	}
}

function JumpMenu(selObj) {
	// ADD onchange="JumpMenu(this)" TO SELECT TAG
	// make sure OPTION values are all complete files, not just variables
	eval("parent.location='"+selObj.options[selObj.selectedIndex].value+"'");
}

function stripCommas(numString) {
	var re = /,/g;
	return numString.replace(re,"");
}

function checkEmail(email) {
	if (/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/.test(email)){
		return true;
	}else{
		return false;
	}
}

function toggleLayer(mylayer) {
	var myelement = document.getElementById(mylayer);
	myelement.style.display = (myelement.style.display != 'none' ? 'none' : '' );
}

// These functions are for talking to Flash ActionScript via Javascript
function getFlashMovie(movieName) {
	if(navigator.appName.indexOf("Microsoft") != -1){
		return window[movieName];
	}
	else{
		return document[movieName];
	}
}
/*
function getFlashMovie(movieName) {
  var isIE = navigator.appName.indexOf("Microsoft") != -1;
  return (isIE) ? window[movieName] : document[movieName];
}
function getFlashMovie(movieName){
	if(window.document[movieName]){
		return window.document[movieName];
	}
	if(navigator.appName.indexOf("Microsoft Internet")==-1){
		if (document.embeds && document.embeds[movieName])
			return document.embeds[movieName]; 
	}
	else{	// if (navigator.appName.indexOf("Microsoft Internet")!=-1)
		return document.getElementById(movieName);
	}
}
*/

var handleErr=function(msg,url,l){
	txt="There was an error on this web page.\n\n";
	txt+="Error: " + msg + "\n";
	txt+="URL: " + url + "\n";
	txt+="Line: " + l + "\n\n";
	txt+="Click OK to continue.\n\n";
	//if(!isIE) alert(txt);
	return true;
}

window.onerror=handleErr;

function callToActionscript(movieName, call) 
{	
	//alert('callToActionscript('+movieName+','+call+')');
//	var mymovie = getFlashMovie(movieName);
//    mymovie.sendToActionscript(call);
	getFlashMovie(movieName).sendToActionscript(call);
}

function callToActionscript1(movieName) 
{	
	//alert('callToActionscript('+movieName+','+call+')');
	var mymovie = getFlashMovie(movieName);
    mymovie.sendToActionscript1();
}

function hideDiv(divID){
	// alert('hideDiv(' + divID + ') called.');
	mydiv = document.getElementById(divID);
	mydiv.style.visibility = "hidden";
}
