//preload = new Image();
//preload.src = "";
CVnn=false
CCrepage(true);
xMSIE=navigator.appName.slice(0,9)=="Microsoft"?true:false
CVswf = ""

function InnerText(xid, xtext) {
	xelem = document.getElementById(xid);
	InTextOK = (document.getElementsByTagName("body")[0].innerText != undefined) ? true : false;
	if(InTextOK) {
		xoldtext = xelem.innerText 
    	xelem.innerText = xtext;
	} else{
		xoldtext = xelem.textContent 
    	xelem.textContent = xtext;
	}
return(xoldtext)}

function FlashDiv(CVdiv, CVwide, CVhi, CVborder) {
	if (typeof(CVborder) == "undefined") {
		CVborder = true
	}
	xdiv1 = '<div id="' + CVdiv + '" align="center" style="visibility:hidden; background:#FFFFFF; '
	if (CVborder) {
		xdiv1 += 'border:inset; '
	}
//	CVwide = CVwide +32
	xdiv1 += 'width:' + CVwide + 'px; height:' + CVhi + 'px; position:absolute">'
	xdivx = '</div>'
	xid = '"'+CVdiv+'"'
	xcdimg = "<div align='right'><img src='../images/close.gif' onclick='FlashPlayStop("+xid+")'></div>"
	xcd0 = '<object type="application/x-shockwave-flash" alt="Video" id="' + CVdiv + 'Player" name="' + CVdiv + 'Player"'
//	xcd0 += ' xmovie="' + CVswf +'"'
	xcd0 += ' data="ZPlayNo.swf" width="' + CVwide + '" height="' + CVhi + '">'
	xcd1 = '<param name="movie" value="ZPlayNo.swf">'
	xcd1 += '<param name="play" value="true">'
	xcd2 = '<param name="salign " value="tl">'
	xcd3 = '<param name="allowScriptAccess" value="always">'
	xcd4 = ''
	xcdend = '</object>'
	document.write(xdiv1+xcdimg)
	document.write(xcd0 + xcd1 + xcd2 + xcd3 + xcd4 + xcdend);
	document.write(xdivx)
}


function FlashPlayGo(xid, xmovie) {
// xmovie arguments / variables after question mark seperated by '[':
//		mp3 file name
//		play speed (optional) - higher number = slower, 250 average
//                            - or enter > 100 into track # of MP3 ID2 
	xdiv = document.getElementById(xid);
	if( typeof( window.innerHeight ) == 'number' ) {
	    //Non-IE
    	xwinwide = window.innerWidth;
	    xwinhi = window.innerHeight;
  	}else{
	    //IE 
	    xwinwide= document.body.offsetWidth;
	    xwinhi= document.body.offsetHeight;
	}
	
	if ( typeof(window.pageYOffset) == 'number' ) {
	    //Non-IE
		xscrolledy = window.pageYOffset
	}else{
	    //IE 
		xscrolledy = document.body.scrollTop
	}
	xhi = parseInt(xdiv.style.height)
	xwide = parseInt(xdiv.style.width)
	xnewtop = xscrolledy + ((xwinhi - xhi) / 2)
	xnewleft = (xwinwide - xwide) / 2
	xdiv.style.top = xnewtop+"px"
	xdiv.style.left = xnewleft+"px"
//	alert(xscrolledy+" : "+xwinhi+" : "+xhi+" : "+xdiv.style.top)
	
	xid2 = xid+"Player"
	xplayer = document.getElementById(xid2)
	xdiv.style.visibility = "visible";
	xmovie = xmovie + "[" + xid
	xplayer.LoadMovie(0, xmovie);
}

function FlashPlayStop(xid) {
	xdiv = document.getElementById(xid);
	xid2 = xid+"Player"
	xplayer = document.getElementById(xid2)
	xplayer.LoadMovie(0, "ZPlayNo.swf");
	xdiv.style.visibility = "hidden";
}

function FlashPlayEnd(xid) {
	FlashPlayStop(xid) 
}

function NoClickSWF(CVswf, CVwide, CVhi) {
	xcd1 = '<object type="application/x-shockwave-flash" data="' + CVswf +' "'
	xcd2 = 'width="' + CVwide + '" height="' + CVhi + '">'
	xcd3 = '<param name="movie" value="' + CVswf +'" /></object>'
	document.write(xcd1 + xcd2 + xcd3);
}

//reloads the window if Nav4 resized
function CCrepage(init) {  
	if (init==true) with (navigator) 
		{if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
			document.CVpgW=innerWidth; document.CVpgH=innerHeight; onresize=CCrepage; 
		}
	}else{
		if (innerWidth!=document.CVpgW || innerHeight!=document.CVpgH) {
			location.reload();
		}
	}
return}

function CCdate() {
	months=new Array("January","February","March","April","May","June","July",
					"August","September","October","November","December")
	today=new Date()
	document.write(months[today.getMonth()] + " " + today.getDate() + ", " + today.getFullYear() +"&nbsp;&nbsp;&nbsp;")
return}

//	This function is used to check the data input.  If you do not want to check any data, 
//		simply eliminate all statements in the function except the last, "return (true)".
//		The checkform function below shows basic validation of the user's email address.
function CCchkform(xform) {
	errmsg=''
	if (xform.name.value == "") {
		errmsg+="Name Required.\n"}
	xemail = xform.from_email.value
	if (xemail == "") {
		if (xform.phone.value == "") {
			errmsg+="Email Address or Phone Required.\n"
		}
	}else{
		xat=xemail.indexOf("@")
		xdot=xemail.lastIndexOf(".")
		if (xat == -1 || xdot == -1 || xat > xdot || xemail.length < 8) {
			errmsg+="Invalid Email Address.\n    Address Format must be 'xx@xx.xx'\n"
		}		
	}
	if (errmsg == "") {return (true)}
	alert (errmsg)
return (false)}

function CCbodytop(xelem) {
	xtop=0
	while (xelem.tagName != "BODY") {
		xtop+=xelem.offsetTop
		xelem=xelem.offsetParent
	}
return xtop}

function CCbodyleft(xelem) {
	xleft=0
	while (xelem.tagName != "BODY") {
		xleft+=xelem.offsetLeft
		xelem=xelem.offsetParent
	}
return xleft}

function CCgoto() {
	xgoto=event.srcElement.href
    CVxwin = window.open(xgoto,"_blank","")
	CVxwin.focus()
return false}

function CCPNG() {
// correctly handle PNG transparency in Win IE 5.5 & 6.
	if (xMSIE) {
      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
         }
      }
   }    
}

