function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function ValidateContact()
{
	var errorstr = '';
		var msgstr = "Sorry, we cannot complete your request.\nKindly provide us the missing or incorrect information enclosed below.\n\n";
		
		with(document.form_contact)
		{ 	
			if (trim(uname.value)=="") { errorstr += "- Please enter your name.\n"; uname.focus();}
			if (trim(email.value)=="") { errorstr += "- Please enter email address.\n"; email.focus();}
			if (!validEmail(email.value)) { errorstr += "- Please enter a valid email address.\n"; }
		}	
		
		if (errorstr != '')
		{
			msgstr = msgstr + errorstr;
			alert(msgstr);
			return false;
		}
		else
		{
			animate();
		}	
}

function validEmail(email) 
{ 
    if (email == ""){return false;} 
    badStuff = ";:/,' \"\\"; 
     
    for (i=0; i<badStuff.length; i++) 
    { 
        badCheck = badStuff.charAt(i) 
        if (email.indexOf(badCheck,0) != -1){return false;} 
    } 

    posOfAtSign = email.indexOf("@",1) 
     
    if (posOfAtSign == -1){return false;} 

    if (email.indexOf("@",posOfAtSign+1) != -1){return false;} 
    posOfPeriod = email.indexOf(".", posOfAtSign) 
     
    if (posOfPeriod == -1){return false;} 
    if (posOfPeriod+2 > email.length){return false;} 
     
return true; 
} 

function ltrim(str)
/***
        PURPOSE: Remove leading blanks from string.
***/
{
        var whitespace = new String(" \t\n\r");
        var s = new String(str);
        if (whitespace.indexOf(s.charAt(0)) != -1) {
            var j=0, i = s.length;
            while (j < i && whitespace.indexOf(s.charAt(j)) != -1)
                j++;
            s = s.substring(j, i);
        }
        return s;
}

function rtrim(str)
/***
        PURPOSE: Remove trailing blanks from our string.
***/
{
        var whitespace = new String(" \t\n\r");
        var s = new String(str);
        if (whitespace.indexOf(s.charAt(s.length-1)) != -1) {
            var i = s.length - 1;       // Get length of string
            while (i >= 0 && whitespace.indexOf(s.charAt(i)) != -1)
                i--;
            s = s.substring(0, i+1);
        }
        return s;
}

function trim(str)
/***
        PURPOSE: Remove trailing and leading blanks from our string.
***/
{
        return rtrim(ltrim(str));
}
var lc="";
function getContent(id,catId) {
	jQuery.ajax({
	type: "POST",
	url: "categoryContent.php",
	data: "id="+id+"&cat_id="+catId,
	success: function(msg){
		jQuery('#catContent').attr('innerHTML', msg);	
		
		jQuery('#catName_'+lc).removeClass('linkorange12');
		jQuery('#catName_'+catId).addClass('linkorange12');
		lc=catId;

		jQuery('#mainCat').removeClass('linkorange12');
		jQuery('#mainCat').addClass('linkgray12');
		
	}
	});
}

/*function mmLoadMenus() {
	  if (window.mm_menu_0) return;
		
		window.mm_menu_0 = new Menu("root",107,19,"Arial, Helvetica, sans-serif",11,"#FFFFFF","#FFFFFF","#F77B0E","#FF9706","left","middle",4,0,500,-5,7,true,true,true,0,true,true);
		
		mm_menu_0.addMenuItem("Gillco Heights","location='project.php?proj_id=21'");
		mm_menu_0.addMenuItem("Gillco Towers","location='project.php?proj_id=5'");
		mm_menu_0.addMenuItem("Gillco Villas","location='project.php?proj_id=15'");
		mm_menu_0.addMenuItem("Ind. Floors","location='project.php?proj_id=25'");
		mm_menu_0.addMenuItem("Gillco Complex","location='project.php?proj_id=16'");
		mm_menu_0.addMenuItem("Gillco Valley","location='project.php?proj_id=2'");

		mm_menu_0.fontWeight="bold";
		mm_menu_0.hideOnMouseOut=true;
		mm_menu_0.bgColor='#FF9706';
		mm_menu_0.menuBorder=1;
		mm_menu_0.menuLiteBgColor='#FF9706';
		mm_menu_0.menuBorderBgColor='#A3C9E4';

		mm_menu_0.writeMenus();

	} // mmLoadMenus()
*/


//----------popup

      function addEvent(obj ,evt, fnc)
      {
        if (obj.addEventListener)
          obj.addEventListener(evt,fnc,false);
        else if (obj.attachEvent)
          obj.attachEvent('on'+evt,fnc);
        else
          return false;
        return true;
      }

      function removeEvent(obj ,evt, fnc)
      {
        if (obj.removeEventListener)
          obj.removeEventListener(evt,fnc,false);
        else if (obj.detachEvent)
          obj.detachEvent('on'+evt,fnc);
        else
          return false;
        return true;
      }

      //----------

      function appendElement(node,tag,id,htm)
      {
        var ne = document.createElement(tag);
        if(id) ne.id = id;
        if(htm) ne.innerHTML = htm;
        node.appendChild(ne);
      }

      //----------

      function showPopup(p)
      {
        greyout(true);
        document.getElementById(p).style.display = 'block';
      }

      function hidePopup(p)
      {
        greyout(false);
        document.getElementById(p).style.display = 'none';
      }

      //----------

      function greyout(d,z)
      {
        var obj = document.getElementById('greyout');

        if(!obj)
        {
          appendElement(document.body,'div','greyout');
          obj = document.getElementById('greyout');
          obj.style.position = 'absolute';
          obj.style.top = '0px';
          obj.style.left = '0px';
          obj.style.background = '#111';
          obj.style.opacity = '.7';
          obj.style.filter = 'alpha(opacity=50)';
        }
        if(d)
        {
          var ch = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
          var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
          var sh = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
          if(document.body.scrollHeight) sh = Math.max(sh,document.body.scrollHeight)
          var sw = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
          if(document.body.scrollWidth) sh = Math.max(sh,document.body.scrollWidth)
          var wh = window.innerHeight ? window.innerHeight : document.body.offsetHeight;
          if(!z){ z = 50 }
          obj.style.zIndex = z;
          obj.style.height = Math.max(wh,Math.max(sh,ch))+'px';
          obj.style.width  = Math.max(sw,cw)+'px';
          obj.style.display = 'block';
          addEvent(window,'resize',greyoutResize);
        }
        else
        {
          obj.style.display = 'none';  
          removeEvent(window,'resize',greyoutResize);
        }
      }

      function greyoutResize()
      {
        var ch = document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight;
        var cw = document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth;
        var sh = document.documentElement.scrollHeight ? document.documentElement.scrollHeight : document.body.scrollHeight;
        if(document.body.scrollHeight) sh = Math.max(sh,document.body.scrollHeight)
        var sw = document.documentElement.scrollWidth ? document.documentElement.scrollWidth : document.body.scrollWidth;
        if(document.body.scrollWidth) sh = Math.max(sh,document.body.scrollWidth)
        var wh = window.innerHeight ? window.innerHeight : document.body.offsetHeight;
        var obj = document.getElementById('greyout');
        obj.style.height = ch+'px';
        obj.style.width  = cw+'px';
        obj.style.height = Math.max(wh,Math.max(sh,ch))+'px';
        obj.style.width  = Math.max(sw,cw)+'px';
      }

      //----------