
var newwindow;
function pop3DEdgeME(url)
{
	newwindow=window.open(url,'name','height=755,width=684,scrollbars=no');
	if (window.focus) {newwindow.focus()}
}

function pop3DEdgeSE(url)
{
	newwindow=window.open(url,'name','height=550,width=700,scrollbars=no');
	if (window.focus) {newwindow.focus()}
}

function pop3DShowRoom(url)
{
	newwindow=window.open(url,'name','height=500,width=620,scrollbars=no');
	if (window.focus) {newwindow.focus()}
}

function updateClock()
{
	var currentTime = new Date();
	var gtm = currentTime.getTimezoneOffset();
	var hours = currentTime.getHours();
	var minutes = currentTime.getMinutes();
	var seconds = currentTime.getSeconds ( );
	var gtm = currentTime.getTimezoneOffset();
	var uaTime;
	var uaHours;
	var uaMinutes;
	var messageString;
	
	uaTime = hours*60 + minutes + gtm + 120;
	uaHours = Math.floor(uaTime/60);
	uaMinutes = uaTime - uaHours*60;
	timeForOpen = (uaHours < 23 ? 9 - hours : 10 ); 
	
	uaMinutes = (uaMinutes < 10 ? "0" : "" ) + uaMinutes;
	minutes = (minutes < 10 ? "0" : "" ) + minutes;
	seconds = (seconds < 10 ? "0" : "" ) + seconds;
	
	//Office open Time left  Calculation
	var hoursForOpen = (uaHours < 22 ? 9 - hours : 24 - uaHours + 9 ); 
	var minutesForOpen = 60 - uaMinutes;
	if (uaHours >= 10 && uaHours < 22){
		messageString = "<strong>Our Office is open</strong><br/> Please call and email to us we will be happy to answer you for all your question.";
		} else {
			messageString = "<strong>Our Office will be open in <br/>" + hoursForOpen + " hours and " + minutesForOpen + " minutes </strong><br/>Please leave a voice mail or send an e-mail to us and we will contact with you.";
			}
	
	
	// Convert the hours component to 12-hour format for Curent time
	var localTimeOfDay = ( hours < 12 ) ? " AM" : " PM";
	hours = ( hours > 12 ) ? hours - 12 : hours;
	
	var uaTimeOfDay = ( uaHours < 12 ) ? " AM" : " PM";
	uaHours = ( uaHours > 12 ) ? uaHours - 12 : uaHours;
	
	
	
	
	var uaTimeString = uaHours + ":" + uaMinutes + ":" + seconds + uaTimeOfDay;
	var localTimeString = "(your local time " + hours + ":" + minutes + ":" + seconds + " " + localTimeOfDay + ")";
	//document.getElementById("clock").firstChild.nodeValue = currentTimeString;
	document.getElementById("uaClock").innerHTML = uaTimeString;
	document.getElementById("localClock").innerHTML = localTimeString;
	document.getElementById("message").innerHTML = messageString;
	}
	
