
CCrepage(true);
xMSIE=navigator.appName.slice(0,9)=="Microsoft"?true:false
if (xMSIE) {
	window.attachEvent("onload", correctPNG)
}

function FlashPlayGo(xid) {
	xdiv = document.getElementById(xid);
	xid2 = xid+"Player"
	xplayer = document.getElementById(xid2)
	xdiv.style.visibility = "visible";
	xmovie = xplayer.getAttribute("xmovie")
	xplayer.LoadMovie(0, xmovie);
}

function FlashPlayStop(xid) {
	xdiv = document.getElementById(xid);
	xid2 = xid+"Player"
	xplayer = document.getElementById(xid2)
	xplayer.LoadMovie(0, "noplay.swf");
	xdiv.style.visibility = "hidden";
}

function FlashDiv(CVdiv, CVswf, CVwide, CVhi, CVborder) {
	if (typeof(CVborder) == "undefined") {
		CVborder = true
	}
	xdiv1 = '<div id="' + CVdiv + '" align="left" style="visibility:hidden; '
	if (CVborder) {
		xdiv1 += 'border:inset; '
	}
//	CVwide = CVwide +32
	xdiv1 += 'width:' + CVwide + 'px; height:' + CVhi + 'px; position:absolute">'
	xdivx = '</div>'
	xid = '"COdiv02"'
	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="noplay.swf" width="' + CVwide + '" height="' + CVhi + '">'
	xcd1 = '<param name="movie" value="noplay.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)
}


//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}

//	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.from_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 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
         }
      }
   }    
}

function CCwritead() {
	emailE=('info' + String.fromCharCode(64) + 'parkcityclubhouse.com')
	document.write('<A HREF="mailto:' + emailE + '" class="textsm">' + emailE + '</a>')
}

