  //Add Marker Icon Code and Marker group Code
  var iconEnter = new GIcon();
  iconEnter.image = '/images/enter.png';
  iconEnter.shadow = '/images/sq_shadow.png';
  iconEnter.iconSize = new GSize(28, 28);
  iconEnter.shadowSize = new GSize(40, 28);
  iconEnter.iconAnchor = new GPoint(6, 20);
  iconEnter.infoWindowAnchor = new GPoint(5, 1);

  var iconHang = new GIcon();
  iconHang.image = '/images/hangouts.png';
  iconHang.shadow = '/images/pin_shadow.png';
  iconHang.iconSize = new GSize(16, 28);
  iconHang.shadowSize = new GSize(40, 28);
  iconHang.iconAnchor = new GPoint(6, 20);
  iconHang.infoWindowAnchor = new GPoint(5, 1);

  var iconCollege = new GIcon();
  iconCollege.image = '/images/college.png';
  iconCollege.shadow = '/images/pin_shadow.png';
  iconCollege.iconSize = new GSize(16, 28);
  iconCollege.shadowSize = new GSize(40, 28);
  iconCollege.iconAnchor = new GPoint(6, 20);
  iconCollege.infoWindowAnchor = new GPoint(5, 1);

  var iconOffice = new GIcon();
  iconOffice.image = '/images/office.png';
  iconOffice.shadow = '/images/pin_shadow.png';
  iconOffice.iconSize = new GSize(16, 28);
  iconOffice.shadowSize = new GSize(40, 28);
  iconOffice.iconAnchor = new GPoint(6, 20);
  iconOffice.infoWindowAnchor = new GPoint(5, 1);

  var iconOthers = new GIcon();
  iconOthers.image = '/images/others.png';
  iconOthers.shadow = '/images/pin_shadow.png';
  iconOthers.iconSize = new GSize(16, 28);
  iconOthers.shadowSize = new GSize(40, 28);
  iconOthers.iconAnchor = new GPoint(6, 20);
  iconOthers.infoWindowAnchor = new GPoint(5, 1);

  var iconRes = new GIcon();
  iconRes.image = '/images/restaurant.png';
  iconRes.shadow = '/images/sq_shadow.png';
  iconRes.iconSize = new GSize(28, 28);
  iconRes.shadowSize = new GSize(40, 28);
  iconRes.iconAnchor = new GPoint(6, 20);
  iconRes.infoWindowAnchor = new GPoint(5, 1);

  var iconBar = new GIcon();
  iconBar.image = '/images/bar.png';
  iconBar.shadow = '/images/sq_shadow.png';
  iconBar.iconSize = new GSize(28, 28);
  iconBar.shadowSize = new GSize(40, 28);
  iconBar.iconAnchor = new GPoint(6, 20);
  iconBar.infoWindowAnchor = new GPoint(5, 1);

  var iconClub = new GIcon();
  iconClub.image = '/images/club.png';
  iconClub.shadow = '/images/sq_shadow.png';
  iconClub.iconSize = new GSize(28, 28);
  iconClub.shadowSize = new GSize(40, 28);
  iconClub.iconAnchor = new GPoint(6, 20);
  iconClub.infoWindowAnchor = new GPoint(5, 1);

  var iconAdven = new GIcon();
  iconAdven.image = '/images/adven.png';
  iconAdven.shadow = '/images/sq_shadow.png';
  iconAdven.iconSize = new GSize(28, 28);
  iconAdven.shadowSize = new GSize(40, 28);
  iconAdven.iconAnchor = new GPoint(6, 20);
  iconAdven.infoWindowAnchor = new GPoint(5, 1);

  var iconAuto = new GIcon();
  iconAuto.image = '/images/auto.png';
  iconAuto.shadow = '/images/pin_shadow.png';
  iconAuto.iconSize = new GSize(16, 28);
  iconAuto.shadowSize = new GSize(40, 28);
  iconAuto.iconAnchor = new GPoint(6, 20);
  iconAuto.infoWindowAnchor = new GPoint(5, 1);

  var iconFriend = new GIcon();
  iconFriend.image = '/images/friend.png';
  iconFriend.shadow = '/images/sq_shadow.png';
  iconFriend.iconSize = new GSize(28, 28);
  iconFriend.shadowSize = new GSize(40, 28);
  iconFriend.iconAnchor = new GPoint(6, 20);
  iconFriend.infoWindowAnchor = new GPoint(5, 1);

  var iconSingle = new GIcon();
  iconSingle.image = '/images/single.png';
  iconSingle.shadow = '/images/sq_shadow.png';
  iconSingle.iconSize = new GSize(28, 28);
  iconSingle.shadowSize = new GSize(40, 28);
  iconSingle.iconAnchor = new GPoint(6, 20);
  iconSingle.infoWindowAnchor = new GPoint(5, 1);

  var iconRealtor = new GIcon();
  iconRealtor.image = '/images/realtor.png';
  iconRealtor.shadow = '/images/sq_shadow.png';
  iconRealtor.iconSize = new GSize(28, 28);
  iconRealtor.shadowSize = new GSize(40, 28);
  iconRealtor.iconAnchor = new GPoint(6, 20);
  iconRealtor.infoWindowAnchor = new GPoint(5, 1);

  var iconArchitect = new GIcon();
  iconArchitect.image = '/images/architect.png';
  iconArchitect.shadow = '/images/pin_shadow.png';
  iconArchitect.iconSize = new GSize(16, 28);
  iconArchitect.shadowSize = new GSize(40, 28);
  iconArchitect.iconAnchor = new GPoint(6, 20);
  iconArchitect.infoWindowAnchor = new GPoint(5, 1);

  var iconAstrology = new GIcon();
  iconAstrology.image = '/images/astrology.png';
  iconAstrology.shadow = '/images/pin_shadow.png';
  iconAstrology.iconSize = new GSize(16, 28);
  iconAstrology.shadowSize = new GSize(40, 28);
  iconAstrology.iconAnchor = new GPoint(6, 20);
  iconAstrology.infoWindowAnchor = new GPoint(5, 1);

  var iconConsultancy = new GIcon();
  iconConsultancy.image = '/images/consultancy.png';
  iconConsultancy.shadow = '/images/pin_shadow.png';
  iconConsultancy.iconSize = new GSize(16, 28);
  iconConsultancy.shadowSize = new GSize(40, 28);
  iconConsultancy.iconAnchor = new GPoint(6, 20);
  iconConsultancy.infoWindowAnchor = new GPoint(5, 1);

  var iconDoctor = new GIcon();
  iconDoctor.image = '/images/doctor.png';
  iconDoctor.shadow = '/images/pin_shadow.png';
  iconDoctor.iconSize = new GSize(16, 28);
  iconDoctor.shadowSize = new GSize(40, 28);
  iconDoctor.iconAnchor = new GPoint(6, 20);
  iconDoctor.infoWindowAnchor = new GPoint(5, 1);

  var iconDog = new GIcon();
  iconDog.image = '/images/dog.png';
  iconDog.shadow = '/images/pin_shadow.png';
  iconDog.iconSize = new GSize(16, 28);
  iconDog.shadowSize = new GSize(40, 28);
  iconDog.iconAnchor = new GPoint(6, 20);
  iconDog.infoWindowAnchor = new GPoint(5, 1);

  var iconEngineering = new GIcon();
  iconEngineering.image = '/images/engin.png';
  iconEngineering.shadow = '/images/pin_shadow.png';
  iconEngineering.iconSize = new GSize(16, 28);
  iconEngineering.shadowSize = new GSize(40, 28);
  iconEngineering.iconAnchor = new GPoint(6, 20);
  iconEngineering.infoWindowAnchor = new GPoint(5, 1);

  var iconEvent = new GIcon();
  iconEvent.image = '/images/event.png';
  iconEvent.shadow = '/images/pin_shadow.png';
  iconEvent.iconSize = new GSize(16, 28);
  iconEvent.shadowSize = new GSize(40, 28);
  iconEvent.iconAnchor = new GPoint(6, 20);
  iconEvent.infoWindowAnchor = new GPoint(5, 1);

  var iconFinance = new GIcon();
  iconFinance.image = '/images/finance.png';
  iconFinance.shadow = '/images/pin_shadow.png';
  iconFinance.iconSize = new GSize(16, 28);
  iconFinance.shadowSize = new GSize(40, 28);
  iconFinance.iconAnchor = new GPoint(6, 20);
  iconFinance.infoWindowAnchor = new GPoint(5, 1);

  var iconInterior = new GIcon();
  iconInterior.image = '/images/interior.png';
  iconInterior.shadow = '/images/pin_shadow.png';
  iconInterior.iconSize = new GSize(16, 28);
  iconInterior.shadowSize = new GSize(40, 28);
  iconInterior.iconAnchor = new GPoint(6, 20);
  iconInterior.infoWindowAnchor = new GPoint(5, 1);

  var iconLawyer = new GIcon();
  iconLawyer.image = '/images/lawyer.png';
  iconLawyer.shadow = '/images/pin_shadow.png';
  iconLawyer.iconSize = new GSize(16, 28);
  iconLawyer.shadowSize = new GSize(40, 28);
  iconLawyer.iconAnchor = new GPoint(6, 20);
  iconLawyer.infoWindowAnchor = new GPoint(5, 1);

  var iconPet = new GIcon();
  iconPet.image = '/images/pet.png';
  iconPet.shadow = '/images/pin_shadow.png';
  iconPet.iconSize = new GSize(16, 28);
  iconPet.shadowSize = new GSize(40, 28);
  iconPet.iconAnchor = new GPoint(6, 20);
  iconPet.infoWindowAnchor = new GPoint(5, 1);

  var customIcons = [];
  customIcons["enter"] = iconEnter;
  customIcons["hangouts"] = iconHang;
  customIcons["college"] = iconCollege;
  customIcons["office"] = iconOffice;
  customIcons["others"] = iconOthers;
  customIcons["restaurant"] = iconRes;
  customIcons["bar"] = iconBar;
  customIcons["club"] = iconClub;
  customIcons["adventure"] = iconAdven;
  customIcons["auto"] = iconAuto;
  customIcons["friend"] = iconFriend;
  customIcons["single"] = iconSingle;
  customIcons["realtor"] = iconRealtor;
  customIcons["architect"] = iconArchitect;
  customIcons["astrology"] = iconAstrology;
  customIcons["consultancy"] = iconConsultancy;
  customIcons["doctor"] = iconDoctor;
  customIcons["dog"] = iconDog;
  customIcons["engineering"] = iconEngineering;
  customIcons["event"] = iconEvent;
  customIcons["finance"] = iconFinance;
  customIcons["interior"] = iconInterior;
  customIcons["lawyer"] = iconLawyer;
  customIcons["pet"] = iconPet;
  
  var markerGroups = { "restaurant": [], "bar": [], "club": [], "adventure":
[], "auto": [], "friend": [], "single": [], "realtor": [], "architect":
[], "astrology": [], "consultancy": [], "doctor": [], "dog": [],
"engineering": [], "event": [], "finance": [], "interior": [],
"lawyer": [], "pet": [], "hangouts": [], "office": [], "college": [], "others": []};

var markerMyGroups = { "friend": [], "restaurant": [], "bar": [], "club": [], 
"hangouts": [], "office": [], "college": [], "others": []};

//General Validation Functions

function emailvalidation(entered, alertbox)
{
with (entered)
{
apos=value.indexOf("@");
dotpos=value.lastIndexOf(".");
lastpos=value.length-1;
if (apos<1 || dotpos-apos<2 || lastpos-dotpos>3 || lastpos-dotpos<2)
{if (alertbox) {alert(alertbox);} return false;}
else {return true;}
}
}

function valuevalidation(entered, min, max, alertbox, datatype)
{
// Value MUST be in the range 0-5
with (entered)
{
checkvalue=parseFloat(value);
if (datatype)
{smalldatatype=datatype.toLowerCase();
if (smalldatatype.charAt(0)=="i") {checkvalue=parseInt(value)};
}
if ((parseFloat(min)==min && checkvalue<min) || (parseFloat(max)==max && checkvalue>max) || value!=checkvalue)
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}


function digitvalidation(entered, min, max, alertbox, datatype)
{
// You MUST enter 3 or 4 integer digits
with (entered)
{
checkvalue=parseFloat(value);
if (datatype)
{smalldatatype=datatype.toLowerCase();
if (smalldatatype.charAt(0)=="i")
{checkvalue=parseInt(value); if (value.indexOf(".")!=-1) {checkvalue=checkvalue+1}};
}
if ((parseFloat(min)==min && value.length<min) || (parseFloat(max)==max && value.length>max) || value!=checkvalue)
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}


function emptyvalidation(entered, alertbox)
{
with (entered)
{
if (entered.value==null || entered.value=="")
{if (alertbox!="") {alert(alertbox);} return false;}
else {return true;}
}
}

function formvalidation(name_field,email,secret_code)
{
// This function checks the entire form before it is submitted
var valid = true;
with (name)
{
if (emptyvalidation(name_field,"Please fill your name")==false) {name_field.focus(); valid = false;return false;};
}
with (email)
{
if (emailvalidation(email,"Illegal E-mail, will be used to when unlisting")==false) {Email.focus(); valid = false;return false;};
}
with (secret_code)
{
if (emptyvalidation(secret_code,"Secret code is required for member validation")==false) {secret_code.focus(); valid = false;return false;};
}
return valid;
}

// Drag-Zoom Function
function setupDragZoom() {
/* first set of options is for the visual overlay.*/
var boxStyleOpts = {
opacity: .2,
border: "2px solid red"
};
/* second set of options is for everything else */
var otherOpts = {
buttonHTML: "<img src='/images/zoom-button.gif' />",
buttonZoomingHTML: "<img src='/images/zoom-button-activated.gif' />",
buttonStartingStyle: {width: '24px', height: '24px'},
overlayRemoveTime: 1000
};

map.addControl(new DragZoomControl(boxStyleOpts, otherOpts, {}),
new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(13, 120)));
}

// Toggle Category Function
function toggleGroup(type) {
      for (var i = 0; i < markerGroups[type].length; i++) {
        var marker = markerGroups[type][i];
        if (marker.isHidden()) {
          marker.show();
        } else {
          marker.hide();
        }
      }
   }

function toggleMyGroup(type) {
      for (var i = 0; i < markerMyGroups[type].length; i++) {
        var marker = markerMyGroups[type][i];
        if (marker.isHidden()) {
          marker.show();
        } else {
          marker.hide();
        }
      }
   }

//AddTofav function.
function addfav(url, sitename){
ns="Netscape and FireFox users, use CTRL+D to bookmark this site."
  if ((navigator.appName=='Microsoft Internet Explorer') &&
    (parseInt(navigator.appVersion)>=4))
  {
    window.external.AddFavorite(url, sitename);
  }
  else if (navigator.appName=='Netscape')
  {
    alert(ns);
  }
}

//tell a friend
function popup(){
		window.open('/tf/tell_a_friend.php', 'tellafriend_script','scrollbars=1,resizable=0,width=400,height=420');
	}
//]]>
//Pop up image window settings