// MODAL OVERLAY SCRIPT

	function overlayOpen(title,divID) {
		
		document.getElementById('overlayContainer').style.display = '';
		document.getElementById('overlayLogin').style.display = 'none';
		document.getElementById('overlayMessage').innerHTML = '<p align="center">Loading . . .</p>';

		var ajaxRequest;  
		
		// CHECK BROWSER COMPATIBILILTY
		try{
			// FIREFOX, SAFARI, OPERA
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// IE
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// ERROR
					alert("An unexpected error occured.");
					return false;
				}
			}
		}
	
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById('overlayMessage');
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
			}
		}
		
		var params = "title="+title+'&divID='+divID;
		
		ajaxRequest.open("POST", "/app/functions/ajaxModalContent.php", true);
		//Send the proper header information along with the request
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", params.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(params); 
	
		
	}
	
	
	
	
	function overlayPortfolio(url) {
		
		document.getElementById('overlayContainer').style.display = '';
		document.getElementById('overlayLogin').style.display = 'none';
		document.getElementById('overlayMessage').innerHTML = '<p align="center">Loading . . .</p>';

		var ajaxRequest;  
		
		// CHECK BROWSER COMPATIBILILTY
		try{
			// FIREFOX, SAFARI, OPERA
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// IE
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// ERROR
					alert("An unexpected error occured.");
					return false;
				}
			}
		}
	
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById('overlayMessage');
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
			}
		}
		
		var params = "url="+url;
		
		ajaxRequest.open("POST", "/app/modules/portfolio/ajaxModalPortfolio.php", true);
		//Send the proper header information along with the request
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", params.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(params); 
	
		
	}
	
	
	
	
	
	function overlayAlert(title, message) {
		
		document.getElementById('overlayContainer').style.display = '';
		document.getElementById('overlayLogin').style.display = 'none';
		document.getElementById('overlayMessage').style.display = '';
		document.getElementById('overlayMessage').innerHTML = '<h2>' + title + '</h2><p>' + message + '</p>';
		
	}
	
	
	
	
	function overlayAttorney(aid) {
		
		if (aid == '') { return; }
		
		// GET VIEWPORT HEIGHT AND RESIZE HOME PHOTO TO FIT VIEWPORT
		var windowHeight;
		var photoHeight;
		
			// the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
			if (typeof window.innerHeight != 'undefined') {
			  windowHeight = window.innerHeight;
			  windowWidth = window.innerWidth;
			}
			 
			// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)
			else if (typeof window.innerHeight == 'undefined') {
			   windowHeight = document.documentElement.clientHeight;
			   windowWidth = document.documentElement.clientWidth;
			}

		// SET overlayModule HEIGHT
		var moduleHeight = windowHeight - 75;
		var messageHeight = moduleHeight - 20;
		
		document.getElementById('overlayContainer').style.display = '';
		document.getElementById('overlayLogin').style.display = 'none';
		document.getElementById('overlayModule').style.height = moduleHeight + 'px';
		document.getElementById('overlayMessage').style.height = messageHeight + 'px';
		document.getElementById('overlayMessage').innerHTML = '<p align="center">Loading Attorney Profile . . .<br />&nbsp;<br /><img src="/app/media/bgs/ajax-loader.gif" /></p>';
		
		var ajaxRequest;  
		
		// CHECK BROWSER COMPATIBILILTY
		try{
			// FIREFOX, SAFARI, OPERA
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// IE
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// ERROR
					alert("An unexpected error occured.");
					return false;
				}
			}
		}
		
		var params = "aid="+aid;
		
		ajaxRequest.open("POST", "/app/modules/attorneys/ajaxAttorneyContent.php", true);
		//Send the proper header information along with the request
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", params.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(params); 
		
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById('overlayMessage');
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
			}
		}
		
	}

	

	function overlayMap(oid) {
		
		if (oid == '') { return; }
		
		document.getElementById('overlayContainer').style.display = '';
		document.getElementById('overlayLogin').style.display = 'none';
		document.getElementById('overlayMessage').innerHTML = '<p align="center">Loading Google Map . . .<br />&nbsp;<br /><img src="/app/media/bgs/ajax-loader.gif" /></p>';
		
		var ajaxRequest;  
		
		// CHECK BROWSER COMPATIBILILTY
		try{
			// FIREFOX, SAFARI, OPERA
			ajaxRequest = new XMLHttpRequest();
		} catch (e){
			// IE
			try{
				ajaxRequest = new ActiveXObject("Msxml2.XMLHTTP");
			} catch (e) {
				try{
					ajaxRequest = new ActiveXObject("Microsoft.XMLHTTP");
				} catch (e){
					// ERROR
					alert("An unexpected error occured.");
					return false;
				}
			}
		}
		
		var params = "oid="+oid;
		
		ajaxRequest.open("POST", "/app/modules/offices/ajaxOfficeMaps.php", true);
		//Send the proper header information along with the request
		ajaxRequest.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
		ajaxRequest.setRequestHeader("Content-length", params.length);
		ajaxRequest.setRequestHeader("Connection", "close");
		ajaxRequest.send(params); 
		
		ajaxRequest.onreadystatechange = function(){
			if(ajaxRequest.readyState == 4){
				var ajaxDisplay = document.getElementById('overlayMessage');
				ajaxDisplay.innerHTML = ajaxRequest.responseText;
				
			}
		}
		
	}




	function overlayClose() {
		document.getElementById('overlayContainer').style.display='none';
	}
