function showHide(elId) {
	$$('#menu>li').map(
		function(el){
			el[el.id.replace('_li', '')==elId?'addClassName':'removeClassName']('selected');
		}
	)
	$$('.submenu').map(
		function(el){
			el[el.id==elId?'show':'hide']();
		}
	)
}
function printContent(documentContainer)
{
    var WindowObject = window.open(WEBSITE_ROOT + 'print.html', "printContent", "width=800,height=600,top=250,left=345,toolbars=no,scrollbars=no,status=no,resizable=no");
    Event.observe(WindowObject, 'load', function(){
			var container = WindowObject.document.getElementById('content');
			container.innerHTML = documentContainer.innerHTML;
			WindowObject.document.close();
	    WindowObject.focus();
	    WindowObject.print();
	    WindowObject.close();
		});
}
function checkform(){
      var reMail = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
      if (document.contact.first_name.value == '') {
        document.contact.first_name.focus();
        alert("Please Type First Name !");
        return(false);
      }

	  if (document.contact.surname.value == '') {
        document.contact.surname.focus();
        alert("Please Type Surname !");
        return(false);
      }

	  if (document.contact.addr1.value == '') {
        document.contact.addr1.focus();
        alert("Please Type Address !");
        return(false);
      }
     
      if ((document.contact.email.value == '') || !reMail.exec(document.contact.email.value)) 	{
        alert("Please Type Valid E-mail Address!");
        document.contact.email.focus();
        return(false);
      }
	  if(!IsValidPhone(document.contact.gsm)){
          alert("Please Type Valid Mobile Phone !");
		  return(false);
        }
       if (document.contact.comments.value == '') {
        alert("Please Type Comments !");
        document.contact.comments.focus();
        return(false);
      }
	  
      return(document.contact.submit());
    }
function IsValidPhone(sText)
{
   var ValidChars = "0123456789()-";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
	  { 
	  Char = sText.charAt(i); 
	  if (ValidChars.indexOf(Char) == -1) 
		 {
			return IsNumber = false;
		 }
	  }
   return IsNumber;
   
}

function initializeGmap(dataHash, targetDiv, size_w, size_h){
	if (!GBrowserIsCompatible()) {
		alert('Your browser does not support Google Maps');
		return;
	}
	Icon = new GIcon();
	Icon.image = dataHash.icon_src;
//	img = new Image();
//	img.src= dataHash.icon_src;
	//Icon.iconSize = new GSize(img.width, img.height);
	Icon.iconAnchor = new GPoint(6, 20);
	Icon.infoWindowAnchor = new GPoint(16, 10);
	myMap = new GMap2(targetDiv, {size: new GSize(size_w, size_h)});
	myMap.addControl(new GMapTypeControl());
	myMap.addControl(new GLargeMapControl3D());
	myMap.enableScrollWheelZoom();
	var point = new GLatLng(dataHash.latitude, dataHash.longitude);
	myMap.setCenter(point, 15);
	myMarkersManager = new MarkerManager(myMap);
	var marker = new GMarker(point, Icon);
	GEvent.addListener(marker, "click", function() {
		marker.openInfoWindow('<b>' + dataHash.title + '</b><br />' + dataHash.description);
  });
	myMarkersManager.addMarker(marker, 0);
	//myMarkersManager.refresh();
}

