function storelocator(theForm)
{
  var checkOK = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ";
  var checkStr = theForm.zip.value;
  var allValid = true;
  var validGroups = true;
  var decPoints = 0;
  var allNum = "";
  var range = "";
  var record = "";
  for (i = 0;  i < checkStr.length;  i++)
  {
    ch = checkStr.charAt(i);
    for (j = 0;  j < checkOK.length;  j++)
      if (ch == checkOK.charAt(j))
        break;
    if (j == checkOK.length)
    {
      allValid = false;
      break;
    }
    allNum += ch;
  }
  if (!allValid || theForm.zip.value == "" || theForm.zip.value.length < 6)
  {
    alert("Please enter at least 6 characters postal code.");
    theForm.zip.focus();
    return (false);
  }
  if (theForm.chkRange.checked == true)
  {
range = "&range="+theForm.range.selectedIndex;
  }
  else
  {
range = "&range=-1";
  }
  if (theForm.chkRecord.checked == true)
  {
record = "&record="+theForm.record.selectedIndex;
  }
  else
  {
record = "&record=-1";
  }

OpenWinParms('http://www.playitdirect.ca/dealerlocator/storelocatorclient.aspx?uid='+theForm.uid.value+'&zip='+theForm.zip.value+range+record,'ZIPCodeWorld',800,600,'no','no','yes','yes','yes','no');
//window.open('http://www.playitdirect.ca/dealerlocator/storelocatorclient.aspx?uid='+theForm.uid.value+'&zip='+theForm.zip.value+range+record,'ZIPCodeWorld','resizable=yes,scrollbars=yes,height=600,width=800',false);
  //window.open('http://localhost/storelocatoradmin/storelocatorclient.aspx?uid='+theForm.uid.value+'&zip='+theForm.zip.value+range+record,'ZIPCodeWorld','resizable=yes,scrollbars=yes,height=600,width=800',false);
  return false;
}

	function popupmap(theForm)
{
  
OpenWinParms('http://www.google.ca/maps?f=q&hl=en&q=+821+Brock+Road,+S.,+Unit+%238,+Pickering,+Ontario,+Canada,+L1W+3L6&ie=UTF8&z=15&om=1&iwloc=addr','Direction',800,600,'no','no','yes','yes','yes','no');
  return false;
}

function OpenWinParms(name,myname,mywidth,myheight,mytool,mydir,mystatus,myscroll,myresize,mymenu) {
var i=0
var OS = 'Win'
var version = "n"
browserVer=navigator.appVersion
App = navigator.appName
var Version=browserVer.substring(0,1)
var posOS = navigator.appVersion.indexOf('Mac')
var posOS2 = navigator.appVersion.indexOf('Win')
if (posOS >= 0) OS = 'Mac'
if ((posOS < 0) && (posOS2 >= 0)) OS = 'Win'
if (App == "Netscape" && Version >= 3) version = "n3";


mytop=Math.floor(((screen.height/2) - (myheight/2)));
myleft=Math.floor(((screen.width/2) - (mywidth/2)));
if (version != "n3" && OS != 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
if (OS == 'Mac') debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
if (version == "n3") {
	debute = window.open(name,myname,"toolbar="+mytool+",width="+mywidth+",height="+myheight+",directories="+mydir+",status="+mystatus+",scrollbars="+myscroll+",top="+mytop+",left="+myleft+",resizable="+myresize+",menubar="+mymenu)
}

debute.focus();
}

