/**
Flash Pseudo Form. 
http://www.theflashlab.net/explore/flashpseudoform/flashpsedoform.html
*/

var globalURL		= "";
var divID			= "contactform";

					// for opera, safari, ns6

var NonCompliant	= ( (navigator.userAgent.indexOf("Opera") > -1) && (navigator.userAgent.indexOf("Opera 8.0") == -1) ) ||  (navigator.userAgent.indexOf("Safari") > -1) || (navigator.userAgent.indexOf("Netscape6") > -1) || ( (navigator.userAgent.indexOf("MSIE 5") > -1) && (navigator.userAgent.indexOf("Mac") > -1) );
var NCheight		= 400;
var NCwidth			= 500;
var winUp			= false;
var eventswindow	= null;

function isIE(){  return /msie/i.test(navigator.userAgent) && !/opera/i.test(navigator.userAgent);}
// flash callout /////////////////////////////////////////////////////
function openContact()
{
	openDIV("lakeview.aspx");
}

function openDirections()
{
    var iHeight = screen.height;
    var iMaxHeight = 820;
    
    if (isIE()) { iMaxHeight = 830; }
    if (iHeight > iMaxHeight) { iHeight = iMaxHeight; }   
    
    // alert("Height of window set to: " + iHeight);    
    
    window.open("directions.aspx","OBCDirections","width=650,height=" + iHeight + ",scrollbars=1,location=0,menubar=0,resizable=no,directories=0");
}
// dom popup     /////////////////////////////////////////////////////
function openDIV(href)
{
	
	var frmHREF = href;
	var iframeID = "domIFRAME";
	frm = document.getElementById(divID)
	if(NonCompliant){
			frm.style.display="none";
			openNonCompliantPopup(globalURL + frmHREF);
		}else{
			frm.style.display="block";
			frm.innerHTML='<iframe src="' + globalURL + frmHREF + '" id="domIFRAME" frameborder="0"></iframe><div id="close"><a href="javascript:closeDIV()">CLOSE</a></div>';
	}
	
}

function closeDIV()
{
	
	frm = document.getElementById(divID)
	frm.style.display="none";
	
	
}

// non compliant: pop up normal window: ///////////////////////////////////

function openNonCompliantPopup(href)
{
	eventswindow = window.open(href,"_events","height=" + NCheight +",width=" + NCwidth +",scrollbars=yes,addressbar=no");
}

