var n=navigator.appName;
var ns = (n.indexOf("Netscape") != -1);
var d = document;
var ie=(n=="Microsoft Internet Explorer");
var d = document;

var menu1 = new Array();

menu1[0] =  '<a class="subMenu" href=\"harishree.php\"  >Harishree Gardens Phase II</a>';
menu1[1] =  '<a class="subMenu" href=\"projects.php\"  >Sobha Emerald</a>';




//Contents for menu 2, and so on
var menuwidth='190px';//default menu width
var menubgcolor='#F7F7F7'; //menu bgcolor
var disappeardelay=250; //menu disappear speed onmouseout (in miliseconds)
var hidemenu_onclick="yes"; //hide menu when user clicks within menu?
/////No further editting needed
var ie4=document.all;
var ns6=document.getElementById&&!document.all;
if (ie4||ns6) document.write('<div id="dropmenudiv" style="visibility:hidden;width:'+menuwidth+';background-color:'+menubgcolor+'" onmouseover="clearhidemenu()" onmouseout="dynamichide(event)"></div>')
function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
		totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
		parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}
function showhide(obj, e, visible, hidden, menuwidth){
	if (ie4||ns6) dropmenuobj.style.left=dropmenuobj.style.top="-500px";
	if (menuwidth!=""){
		dropmenuobj.widthobj=dropmenuobj.style;
		dropmenuobj.widthobj.width=menuwidth;
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover") obj.visibility=visible;
	else if (e.type=="click") obj.visibility=hidden;
}
function iecompattest(){return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body;}
function clearbrowseredge(obj, whichedge){
	var edgeoffset=0;
	if (whichedge=="rightedge"){
		var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15;
		dropmenuobj.contentmeasure=dropmenuobj.offsetWidth;
		if (windowedge-dropmenuobj.x < dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.contentmeasure-obj.offsetWidth;
	}else{
		var topedge=ie4 && !window.opera? iecompattest().scrollTop : window.pageYOffset;
		var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18;
		dropmenuobj.contentmeasure=dropmenuobj.offsetHeight;
		//move up?
		if (windowedge-dropmenuobj.y < dropmenuobj.contentmeasure){
			edgeoffset=dropmenuobj.contentmeasure+obj.offsetHeight;
			//up no good either?
			if ((dropmenuobj.y-topedge)<dropmenuobj.contentmeasure) edgeoffset=dropmenuobj.y+obj.offsetHeight-topedge;
		}
	}
	return edgeoffset;
}
function populatemenu(what){
	if (ie4||ns6) dropmenuobj.innerHTML=what.join("");
}
function dropdownmenu(obj, e, menucontents, menuwidth){
	if (window.event) event.cancelBubble=true; else if (e.stopPropagation) e.stopPropagation();
	clearhidemenu();
	dropmenuobj=document.getElementById? document.getElementById("dropmenudiv") : dropmenudiv;
	populatemenu(menucontents);
	if (ie4||ns6){
		showhide(dropmenuobj.style, e, "visible", "hidden", menuwidth);
		var pos = ip.getPos(obj);
		var pageSizeArr = ip.getPageSize();
		//obj.style.border="1px solid red";
		with(dropmenuobj.style){
			/*ip.print("pos.x =" +pos.x);
			ip.print(pageSizeArr);
			ip.print(pageSizeArr[0]-pos.x);
			ip.print("ip.mouseX="+ip.mouseX);
			ip.print("ip.mouseY="+ip.mouseY);*/
			if(pageSizeArr[0]-pos.x < 200 && pageSizeArr[0]-ip.mouseX > 200){
				left=ip.mouseX + "px";
				top = ip.mouseY + 15 + "px";
			}else{
				left = pos.x + "px";
				top = pos.y + 15 + "px";
			}
		}
		/*dropmenuobj.x=getposOffset(obj, "left");
		dropmenuobj.y=getposOffset(obj, "top");
		dropmenuobj.style.left=dropmenuobj.x-clearbrowseredge(obj, "rightedge")+"px";
		dropmenuobj.style.top=dropmenuobj.y-clearbrowseredge(obj, "bottomedge")+obj.offsetHeight+"px";*/
	}
	return clickreturnvalue();
}
function clickreturnvalue(){
	if (ie4||ns6) return false; else return true;
}
function contains_ns6(a, b) {
	while (b.parentNode) if ((b = b.parentNode) == a) return true;
	return false;
}
function dynamichide(e){
	if (ie4&&!dropmenuobj.contains(e.toElement)) delayhidemenu();
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget)) delayhidemenu();
}
function hidemenu(e){
	if (typeof dropmenuobj!="undefined"){
		if (ie4||ns6) dropmenuobj.style.visibility="hidden";
	}
}
function delayhidemenu(){
	if (ie4||ns6) delayhide=setTimeout("hidemenu()",disappeardelay);
}
function clearhidemenu(){
	if (typeof delayhide!="undefined") clearTimeout(delayhide);
}
if (hidemenu_onclick=="yes") document.onclick=hidemenu;
var ip = {
	getPos: function(inputElement) {
		var coords =  new Object();
		coords.x = 0;
		coords.y = 0;
		try {
			targetElement = inputElement;
			if(targetElement.x && targetElement.y) {
				coords.x = targetElement.x;
				coords.y = targetElement.y;
			} else {
				if(targetElement.offsetParent) {
					coords.x += targetElement.offsetLeft;
					coords.y += targetElement.offsetTop;
					while(targetElement = targetElement.offsetParent) {
						coords.x += targetElement.offsetLeft;
						coords.y += targetElement.offsetTop;
					}
				} else {
					/*/alert("Could not find any reference for coordinate positioning.");*/
				}
			}
			return coords;
		} catch(e){
			ip.traceErr(e,"getPos","ipCommon");
			return coords;
		}
	},
	getPageSize : function(){
		var xScroll, yScroll;
		if (window.innerHeight && window.scrollMaxY) {
			xScroll = d.body.scrollWidth;
			yScroll = window.innerHeight + window.scrollMaxY;
		} else if (d.body.scrollHeight > d.body.offsetHeight){ /* all but Explorer Mac*/
			xScroll = d.body.scrollWidth;
			yScroll = d.body.scrollHeight;
		} else { /* Explorer Mac...would also work in Explorer 6 Strict, Mozilla and Safari*/
			xScroll = d.body.offsetWidth;
			yScroll = d.body.offsetHeight;
		}
		var windowWidth, windowHeight;
		if (self.innerHeight) {	/* all except Explorer*/
			windowWidth = self.innerWidth;
			windowHeight = self.innerHeight;
		} else if (d.documentElement && d.documentElement.clientHeight) { /* Explorer 6 Strict Mode*/
			windowWidth = d.documentElement.clientWidth;
			windowHeight = d.documentElement.clientHeight;
		} else if (d.body) { /* other Explorers */
			windowWidth = d.body.clientWidth;
			windowHeight = d.body.clientHeight;
		}
		/* for small pages with total height less then height of the viewport*/
		if(yScroll < windowHeight){
			pageHeight = windowHeight;
		} else {
			pageHeight = yScroll;
		}
		/* for small pages with total width less then width of the viewport*/
		if(xScroll < windowWidth){pageWidth = windowWidth;} else {pageWidth = xScroll;}
		arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight);
		return arrayPageSize;
	},


	startMouseDetect : function(){
		if(!ie){ if(d.captureEvents && Event.MOUSEMOVE) d.captureEvents(Event.MOUSEMOVE);}
		d.onmousemove = this.getMouseXY;
	},

	getMouseXY : function(e){
		if( !e ) { e = window.event; }
		if( !e ) { return; }
		if( typeof( e.pageX ) == 'number' ) {
			ip.mouseX = e.pageX;
			ip.mouseY = e.pageY;
		} else if( typeof( e.clientX ) == 'number' ) {
			ip.mouseX = e.clientX;
			ip.mouseY = e.clientY;
			if( d.body && ( d.body.scrollLeft || d.body.scrollTop ) ) {
				ip.mouseX += d.body.scrollLeft;
				ip.mouseY += d.body.scrollTop;
			} else if( d.documentElement && ( d.documentElement.scrollLeft || d.documentElement.scrollTop ) ) {
				ip.mouseX += d.documentElement.scrollLeft;
				ip.mouseY += d.documentElement.scrollTop;
			}
		}else { return; }
		return;
	}
}