function initFlash(detection){
	switch (detection){
		case "fulldetect":
			FlashControl.createSWFObject(
				"ar7loader.swf",
				{
					width:"100%",
					height:"100%",
					bgcolor:"#ffffff",
					quality:"high",
					align:"left",
					salign:"t",
					allowScriptAccess:"sameDomain",
					id:"AR7swf"
				},
				"content_wrapper",
				{
					detectFlash:true,
					flashVersion:8,
					detectResolution:true,
					resolutionY:700,
					resolutionX:900,
					//detectViewport:true,
					//viewportY:400,
					//viewportX:600,
					onError:errorHandler
				}
			)
		break;
		case "nodetect":
			FlashControl.createSWFObject(
				"ar7.swf",
				{
					width:"100%",
					height:"100%",
					bgcolor:"#ffffff",
					quality:"high",
					align:"left",
					salign:"t",
					allowScriptAccess:"sameDomain",
					id:"AR7swf"
				},
				"content_wrapper",
				{
					detectFlash:false,
					detectResolution:false
				}
			)
		break;
	}
}
function errorHandler(err,erros){
	var wrapper = document.getElementById("content_wrapper")
	var _html=""
	
	switch (err){
		case "invalidFlash":
			_html+= '<div id="header"><a href="http://www.macromedia.com/go/getflashplayer" target="_blank"><img src="data/htmlimages/Error-NoFlash.gif" alt="You Need Flash: Download Now" /></a></div>'
			wrapper.innerHTML = _html
		break;
		case "invalidResolution":
			//alert("invalid Resolution");
			/*if (ScreenControl.resolutionY()>700){
				
				_html+= '<div id="header"><img src="data/htmlimages/Error-Resolution.gif" alt="AR7 Architects" /><a href="javascript:popSite()"><img src="data/htmlimages/Error-ProceedAnyway.gif" alt="Proceed Anyway" /></a></div>'
				wrapper.innerHTML = _html
				//popSite();
				
			}else{
				_html+= '<div id="header"><img src="data/htmlimages/Error-Resolution.gif" alt="You Need a Minimum Resolution of 1024x768" /></div>'
				wrapper.innerHTML = _html
			}*/
			_html+= '<div id="header"><img src="data/htmlimages/Error-Resolution.gif" alt="You Need a Minimum Resolution of 1024x768" /></div>'
			wrapper.innerHTML = _html
			//popSite();
		break;
	}
	
	

}

function expandWindow(){
	//var w = screen.availWidth;
	//var h = screen.availHeight;
	//window.resizeTo(w, h);	
	//window.moveTo(0,0);
  self.moveTo(0,0);
  self.resizeTo(screen.availWidth,screen.availHeight);
}

function popSite(){
	var ar7Site=window.open("index.aspx?action=nodetect","_ar7","width=" + screen.width + ",height=" + screen.width + ",toolbars=no,scrolling=no,addressbar=no,statusbar=no")
	if (ar7Site){
		ar7Site.focus()
	}else{
		alert("It appears you have a pop-up blocker installed. \r\nPlease enable popups to view our fancy new site.");
	}
}


	
