//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; '
	if (CVborder) {
		xdiv1 += 'border:inset; '
	}
	xdiv1 += 'width:' + CVwide + 'px; height:' + CVhi + 'px; position:relative">'
	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 += ' 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 = '<param name="bgcolor" value="#000000">'
	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);
	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())
return}

function CCcountry() {
	xgo=document.countrys.sel_country.value
	self.location="country/00proplist.asp?Country="+xgo
return}

function CCcountry2(xthis) {
	xgo=xthis.value
	self.location="00proplist.asp?Country="+xgo
return}

function CCproplist(xquery) {
	self.location="00proplist.asp?"+xquery
return}

function CCpropdetl(xid) {
	document.proplist.getid.value=xid
	document.proplist.submit()
return}

function CCdetlop(xop) {
	document.propdetl.skipop.value=xop
	document.propdetl.submit()
}

//	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 CChear() {
xsel=document.contact.selhear_.options[document.contact.selhear_.selectedIndex].text
xchk=xsel.slice(0,5)
if (xchk == "Other" || xchk == "-- Se") {
	document.contact.howhear.value=""
}else{
	document.contact.howhear.value=xsel
}
return}

function menuother() {
	if (xMSIE) {
		othermenu.style.visibility="visible"
	}
}

function menuout(xevent) {
	if (xMSIE) {
		xleft=othermenu.style.left.slice(0,-2)/1
		xright=othermenu.style.width.slice(0,-2)/1
		xright+=xleft
		xleft+=2
		xtop=othermenu.style.top.slice(0,-2)/1
		xbott=othermenu.style.height.slice(0,-2)/1
//NOTE - factor document.body.scrollTop and scrollLeft into calculation
//alert(document.body.scrollTop)
		xtop-=document.body.scrollTop 
		xleft-=document.body.scrollLeft
		xright-=document.body.scrollLeft
		xbott+=xtop
		xtop+=2
		if (event.clientX < xleft || event.clientX > xright) {
			othermenu.style.visibility="hidden"}
		if (event.clientY < xtop || event.clientY > xbott) {
			othermenu.style.visibility="hidden"}
	}
}

function menuNN(xleft) {
	if (!xMSIE) {
		if (document.othermenu.visibility=="hide") {
			document.othermenu.left=30
			document.othermenu.top=240
			document.othermenu.visibility="show"
		}else{
			document.othermenu.visibility="hide"
		}
	}
}

function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
// Add to HTML file with PNG:  window.attachEvent("onload", correctPNG);
{  var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      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
         }
      }
   }    
}

