function initFlash(detection){
	//alert('detection' + document.bgColor)
	expandWindow()
	switch (detection){
		case "fulldetect":
			FlashControl.createSWFObject(
				"preston.swf",
				{
					width:"100%",
					height:"100%",
					bgcolor:"#000000",
					quality:"high",
					align:"middle",
					salign:"t",
					allowScriptAccess:"sameDomain",
					id:"preston"
				},
				"content_wrapper",
				{
					detectFlash:true,
					flashVersion:9,
					detectResolution:false,
					resolutionY:800,
					//resolutionX:1190,
					/* detectViewport:true,
					viewportY:1000,
					viewportX:700, */
					onError:errorHandler
				}
			)
		break;
		case "nodetect":
			FlashControl.createSWFObject(
				"preston.swf",
				{
					width:"100%",
					height:"100%",
					bgcolor:"#000000",
					quality:"high",
					align:"middle",
					salign:"t",
					allowScriptAccess:"sameDomain",
					id:"preston"
				},
				"content_wrapper",
				{
					detectFlash:false,
					detectResolution:false
				}
			)
		break;
	}
}

function expandWindow(){
  self.moveTo(0,0);
  self.resizeTo(screen.availWidth,screen.availHeight);
}

function errorHandler(err,erros){
	var wrapper = document.getElementById("content_wrapper")
	var _html=""
	
	switch (err){
		case "invalidFlash":
			location = "noFlash.html"
		break;
		case "invalidResolution":
			if (ScreenControl.resolutionY()>=768){
				//location = "lowRes.html"
				seePrestonWithScroll()
			}else{
				location = "noRes.html"
			}
		break;
	}
}

function initSite(d){
	var wrapper = document.getElementById("content_wrapper")
	var _html=""
	_html+= '<div><a href="javascript:seePrestonLake()"><img src="http://prestonlakeva.com/data/htmlimages/LandingPages_LaunchMe.gif" border="0" /></a></div>'
	wrapper.innerHTML = _html
	seePrestonLake()
	
}
function seePrestonWithScroll(){
	var prestonwin = window.open('site.aspx?detect=nodetect', 'preston', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=yes,width='+screen.availWidth+',height='+screen.availHeight)
	if (prestonwin==undefined){
		var a = 'Welcome to Preston Lake. Please relaunch this site by clicking the link below and enable "popups" for future visits.'
		alert(a)
	}else{
		prestonwin.focus()
	}
}
function seePrestonLake(){
	//alert('exploreRFP()');
	
	var prestonwin = window.open('site.aspx?detect=nodetect', 'preston', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=yes,width='+screen.availWidth+',height='+screen.availHeight)
	if (prestonwin==undefined){
		var a = 'Welcome to Preston Lake. Please relaunch this site by clicking the link below and enable "popups" for future visits.'
		alert(a)
	}else{
		prestonwin.focus()
	}
			
}



	
