function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
var newWindow = null
function openWin(URL, windowName, windowFeatures) {
  if (!newWindow || newWindow.closed) {
    newWindow = window.open(URL, windowName, windowFeatures)
  }
  newWindow.focus()
}
msiemacsize = 0;
function isaMac() { if (navigator.appVersion.indexOf("PPC") != -1 || navigator.appVersion.indexOf("68K") != -1) return true; else return false; }
if (navigator.appName == "Microsoft Internet Explorer" && isaMac() && parseInt(navigator.appVersion) <= 4 && navigator.appVersion.indexOf('MSIE 5') == -1)
	msiemacsize = 14;
function popWin(goPage,nom,windowWidth,windowHeight) 
{
	if (parseInt(navigator.appVersion) >= 4) { wX = (screen.width/2)-(windowWidth/2+10); wY = (screen.height/2)-(windowHeight/2+20); }
	else { wX = 0; wY = 0; }
	var popped = window.open(goPage,nom,'width='+windowWidth+',height='+(windowHeight+msiemacsize)+',status=no,menubar=no,scrollbars=no,resizable=yes,screenX='+wX+',screenY='+wY+',left='+wX+',top='+wY);
	if (navigator.appName=="Netscape" || document.all) popped.focus();
}
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);
myBrowser=navigator.appName
myVersion=navigator.appVersion
var version45=(myVersion.indexOf("4.")!=-1||myVersion.indexOf("5.")!=-1||myVersion.indexOf("6.")!=-1)
var NS=(myBrowser.indexOf("Netscape")!=-1 && version45)
var IE=(myBrowser.indexOf("Explorer")!=-1 && version45)
var pageHt=1000
var pageWt=800
function centerIt(){
   	if(IE){
		var theWindHt=document.body.clientHeight
    	var theWindWt=document.body.clientWidth
   	}
	if(NS){
     	var theWindHt=window.innerHeight
    	var theWindWt=window.innerWidth
   	}
   	theTop=parseInt((theWindHt-pageHt)/2)
   	theLeft=parseInt((theWindWt-pageWt)/2)
	if(NS){
		if(theTop<=0)theTop=5
		if(theLeft<=0)theLeft=5
		//document.getElementById("cContainer").style.top=theTop
		document.getElementById("cContainer").style.left=theLeft
   	}
   	if(IE){
		if(theTop<=0)theTop=5
		if(theLeft<=0)theLeft=5
		//document.all.cContainer.style.top=theTop
		document.all.cContainer.style.left=theLeft
	}
}
function reloadAgain(){
  if(innerWidth!=origWidth||innerHeight!=origHeight)
    location.reload()
}
var EImg='images/spacer_trans.gif'

function validEmail(strEmail) {
	var matchArr1=strEmail.match(/^[A-Za-z0-9_.-]+@[A-Za-z0-9_.-]+\.([a-z|A-Z]{2,3})$/);
	if (matchArr1==null) {
		return false
	} else {
		return true
	}
}

function validPhone(strPhone) {
	var matchArr1=strPhone.match(/^(\d{3})-?\d{3}-?\d{4}$/);
	var matchArr2=strPhone.match(/^(\(\d{3})\) ?\d{3}-?\d{4}$/);
	var matchArr3=strPhone.match(/^(\d{3}) ?\d{3} ?\d{4}$/);
	if (matchArr1==null && matchArr2==null && matchArr3==null) {
		return false
	} else {
		return true
	}
}

function validSSN(strSSN) {
	var matchArr=strSSN.match(/^(\d{3})-?\d{2}-?\d{4}$/);
	var matchArr1=strSSN.match(/^(\d{3}) ?\d{2} ?\d{4}$/);
	if (matchArr==null && matchArr1==null) {
		return false
	} else {
		return true
	}
}

function validSIN(strSIN) {
	var matchArr=strSIN.match(/^(\d{3})-?\d{3}-?\d{3}$/);
	var matchArr1=strSIN.match(/^(\d{3}) ?\d{3} ?\d{3}$/);
	if (matchArr==null && matchArr1==null) {
		return false
	} else {
		return true
	}
}
function formatCurrency(num){
num = num.toString().replace(/\$|\,/g,'')
if(isNaN(num))
num = "0"
sign = (num == (num = Math.abs(num)))
num = Math.floor(num*100+0.50000000001)
cents = num%100
num = Math.floor(num/100).toString()
if(cents<10)
cents = "0" + cents
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3))
return (((sign)?'':'-') + '$' + num + '.' + cents)
}
