/* COPYRIGHT MOONSHAPES 2009 */

function IsNumeric(strString, decimals)
   //  check for valid numeric strings	
   {
	var strValidChars = "0123456789";
	var strChar;
	var blnResult = true;

	if (decimals)
		strValidChars = strValidChars + ".,";

   if (strString.length == 0) return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }
   
function ValidateEmail(origin)
{
    // Email adress regular expression
    myRE = new RegExp(/^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$/);

    results = myRE.exec(origin); 
    
    return (results!=null);
}

function HighlightCurrentMenu(lnkID)
{
    var lnk = document.getElementById(lnkID);  
    lnk.style.fontWeight = "bold";
}

function GenerateGMAP()
{
    if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(37.105232372904396, -8.679542541503906), 14);
		
		var icon = new GIcon();
	    icon.image = "Images/" +loc1;
	    icon.iconSize=new GSize(46,28); 
	    icon.iconAnchor=new GPoint(22,27);
	    
	    var icon2 = new GIcon();
	    //icon2.image = "Images/loja_2.gif";
	    icon2.image = "Images/" + loc2;
	    icon2.iconSize=new GSize(46,28); 
	    icon2.iconAnchor=new GPoint(22,27);
	    
	    var icon3 = new GIcon();
	    //icon3.image = "Images/loja_3.gif";
	    icon3.image = "Images/" + loc3;
	    icon3.iconSize=new GSize(46,28); 
	    icon3.iconAnchor=new GPoint(22,27);
		
        // Set map type
        //map.setMapType(G_HYBRID_MAP);
        map.setMapType(G_NORMAL_MAP);
		
		//map.addControl(new GMapKitMapControls3d());
        map.addControl(new GSmallMapControl());				 
        map.addControl(new GMapTypeControl());		
	
	    var opts = new Object(); opts.icon = icon; opts.title = "1";			
        var marker = new GMarker(new GLatLng(37.110554363856586, -8.680315017700195),opts);
        map.addOverlay(marker);
        
        var opts2 = new Object(); opts2.icon = icon2; opts2.title = "2";			
        var marker2 = new GMarker(new GLatLng(37.10135615378313, -8.679252862930297),opts2);
        map.addOverlay(marker2);
        
        var opts3 = new Object(); opts3.icon = icon3; opts.title = "3";			
        var marker3 = new GMarker(new GLatLng(37.0975310808875, -8.680744171142578),opts3);
        map.addOverlay(marker3);
        
    }
}
