function ProgressbarMapControl(map, width) { 
  this.map_ = map; 
}

ProgressbarMapControl.prototype = new GControl(true, false);

ProgressbarMapControl.prototype.initialize = function () {
  var container_ = document.createElement('div');
  container_.innerHTML = '<div style="position:absolute;width:100%;border:5px;text-align:center;" id="geo_progress_text"></div>'
    + '<div style="background-color:#5e6a71;height:100%;" id="geo_progress"></div>';
  container_.id = "geo_progress_container";
  container_.style.display = "none";
  container_.style.width = "237px";
  container_.style.fontSize = "1.65em";
  container_.style.fontWeight = "bold";
  container_.style.height = "1.2em";
  container_.style.backgroundColor = "#003c69";
  container_.style.textAlign = "left";
  this.map_.getContainer().appendChild(container_);
  return container_;
};

ProgressbarMapControl.prototype.getDefaultPosition = function () {
  return new GControlPosition(G_ANCHOR_TOP_RIGHT, new GSize(269, 222));
};

function ProgressbarControl(map, opt_opts) {
  this.options_ = opt_opts || {};
  this.loadstring_ = this.options_.loadstring || 'Loading...';
  this.control_ = new ProgressbarMapControl(map);
  this.map_ = map;
  this.map_.addControl(this.control_);
  this.div_ = document.getElementById('geo_progress');
  this.text_ = document.getElementById('geo_progress_text');
  this.container_ = document.getElementById('geo_progress_container');
  this.operations_ = 0;
  this.current_ = 0;
}

ProgressbarControl.prototype.start = function (operations) {
  this.div_.style.width = '0%'; 
  this.operations_ = operations || 1;
  this.current_ = 0;
  this.text_.style.color = "#fff";
  this.text_.innerHTML = this.loadstring_;
  this.container_.style.display = "block";
};

ProgressbarControl.prototype.updateLoader = function (step) {
  this.current_ += step;
  if (this.current_ > 0) {
    var percentage_ = Math.ceil((this.current_ / this.operations_) * 100);
    if (percentage_ > 100) { 
      percentage_ = 100; 
    }
    this.div_.style.width = percentage_ + '%'; 
    this.text_.innerHTML = this.current_ + ' / ' + this.operations_;
  }
};

ProgressbarControl.prototype.remove = function () {
  this.container_.style.display = 'none';
};

var map;
var progressBar;
var mapMarkers = [];
var mapHTMLS = [];
var maxNum = 0;
var num = 0;

var adoIcon = new GIcon();
adoIcon.image = "http://wsuwest.wsu.edu/map/markers/ado.png";
adoIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
adoIcon.iconSize = new GSize(14, 23);
adoIcon.shadowSize = new GSize(26, 23);
adoIcon.iconAnchor = new GPoint(7, 23);
adoIcon.infoWindowAnchor = new GPoint(7, 11);

var campusIcon = new GIcon();
campusIcon.image = "http://wsuwest.wsu.edu/map/markers/campus.png";
campusIcon.shadow = "http://wsuwest.wsu.edu/map/markers/campus-shadow.png";
campusIcon.iconSize = new GSize(20, 22);
campusIcon.shadowSize = new GSize(32, 22);
campusIcon.iconAnchor = new GPoint(10, 22);
campusIcon.infoWindowAnchor = new GPoint(10, 11);

var ctcIcon = new GIcon(); 
ctcIcon.image = 'http://wsuwest.wsu.edu/map/markers/ctc.png';
ctcIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/ctc-shadow.png';
ctcIcon.iconSize = new GSize(14, 15);
ctcIcon.shadowSize = new GSize(22, 15);
ctcIcon.iconAnchor = new GPoint(7, 15);
ctcIcon.infoWindowAnchor = new GPoint(7, 7);

var ctedIcon = new GIcon(); 
ctedIcon.image = 'http://wsuwest.wsu.edu/map/markers/cted.png';
ctedIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/cted-shadow.png';
ctedIcon.iconSize = new GSize(16, 21);
ctedIcon.shadowSize = new GSize(27, 21);
ctedIcon.iconAnchor = new GPoint(8, 21);
ctedIcon.infoWindowAnchor = new GPoint(8, 10);

var cwuIcon = new GIcon();
cwuIcon.image = "http://wsuwest.wsu.edu/map/markers/cwu.png";
cwuIcon.shadow = "http://wsuwest.wsu.edu/map/markers/wwu-shadow.png";
cwuIcon.iconSize = new GSize(21, 20);
cwuIcon.shadowSize = new GSize(32, 20);
cwuIcon.iconAnchor = new GPoint(10, 20);
cwuIcon.infoWindowAnchor = new GPoint(10, 10);

var edaIcon = new GIcon();
edaIcon.image = "http://wsuwest.wsu.edu/map/markers/eda.png";
edaIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
edaIcon.iconSize = new GSize(14, 23);
edaIcon.shadowSize = new GSize(26, 23);
edaIcon.iconAnchor = new GPoint(7, 23);
edaIcon.infoWindowAnchor = new GPoint(7, 11);

var eddIcon = new GIcon();
eddIcon.image = "http://wsuwest.wsu.edu/map/markers/edd.png";
eddIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
eddIcon.iconSize = new GSize(14, 23);
eddIcon.shadowSize = new GSize(26, 23);
eddIcon.iconAnchor = new GPoint(7, 23);
eddIcon.infoWindowAnchor = new GPoint(7, 11);

var energyIcon = new GIcon(); 
energyIcon.image = 'http://wsuwest.wsu.edu/map/markers/energy.png';
energyIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/energy-shadow.png';
energyIcon.iconSize = new GSize(17, 17);
energyIcon.shadowSize = new GSize(26, 17);
energyIcon.iconAnchor = new GPoint(8, 17);
energyIcon.infoWindowAnchor = new GPoint(8, 8);

var escIcon = new GIcon();
escIcon.image = "http://wsuwest.wsu.edu/map/markers/esc.png";
escIcon.shadow = "http://wsuwest.wsu.edu/map/markers/esc-shadow.png";
escIcon.iconSize = new GSize(18, 20);
escIcon.shadowSize = new GSize(29, 20);
escIcon.iconAnchor = new GPoint(9, 20);
escIcon.infoWindowAnchor = new GPoint(9, 10);

var ewuIcon = new GIcon();
ewuIcon.image = "http://wsuwest.wsu.edu/map/markers/ewu.png";
ewuIcon.shadow = "http://wsuwest.wsu.edu/map/markers/ewu-shadow.png";
ewuIcon.iconSize = new GSize(23, 22);
ewuIcon.shadowSize = new GSize(35, 22);
ewuIcon.iconAnchor = new GPoint(11, 22);
ewuIcon.infoWindowAnchor = new GPoint(11, 11);

var extcoIcon = new GIcon(); 
extcoIcon.image = 'http://wsuwest.wsu.edu/map/markers/ext.png';
extcoIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/ext-shadow.png';
extcoIcon.iconSize = new GSize(15, 17);
extcoIcon.shadowSize = new GSize(24, 17);
extcoIcon.iconAnchor = new GPoint(7, 17);
extcoIcon.infoWindowAnchor = new GPoint(7, 8);

var farmsIcon = new GIcon(); 
farmsIcon.image = 'http://wsuwest.wsu.edu/map/markers/farms.png';
farmsIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/farms-shadow.png';
farmsIcon.iconSize = new GSize(20, 13);
farmsIcon.shadowSize = new GSize(27, 13);
farmsIcon.iconAnchor = new GPoint(10, 13);
farmsIcon.infoWindowAnchor = new GPoint(10, 6);

var ipzIcon = new GIcon();
ipzIcon.image = "http://wsuwest.wsu.edu/map/markers/ipz.png";
ipzIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
ipzIcon.iconSize = new GSize(14, 23);
ipzIcon.shadowSize = new GSize(26, 23);
ipzIcon.iconAnchor = new GPoint(7, 23);
ipzIcon.infoWindowAnchor = new GPoint(7, 11);

var lcIcon = new GIcon(); 
lcIcon.image = 'http://wsuwest.wsu.edu/map/markers/lc.png';
lcIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/lc-shadow.png';
lcIcon.iconSize = new GSize(21, 16);
lcIcon.shadowSize = new GSize(30, 16);
lcIcon.iconAnchor = new GPoint(10, 16);
lcIcon.infoWindowAnchor = new GPoint(10, 9);

var pnnlIcon = new GIcon();
pnnlIcon.image = "http://wsuwest.wsu.edu/map/markers/pnnl.png";
pnnlIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
pnnlIcon.iconSize = new GSize(14, 23);
pnnlIcon.shadowSize = new GSize(26, 23);
pnnlIcon.iconAnchor = new GPoint(7, 23);
pnnlIcon.infoWindowAnchor = new GPoint(7, 11);

var portIcon = new GIcon(); 
portIcon.image = 'http://wsuwest.wsu.edu/map/markers/port.png';
portIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/port-shadow.png';
portIcon.iconSize = new GSize(20, 20);
portIcon.shadowSize = new GSize(31, 20);
portIcon.iconAnchor = new GPoint(10, 20);
portIcon.infoWindowAnchor = new GPoint(10, 10);

var recIcon = new GIcon(); 
recIcon.image = 'http://wsuwest.wsu.edu/map/markers/rec.png';
recIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/rec-shadow.png';
recIcon.iconSize = new GSize(20, 18);
recIcon.shadowSize = new GSize(30, 18);
recIcon.iconAnchor = new GPoint(10, 18);
recIcon.infoWindowAnchor = new GPoint(10, 9);

var sbdcIcon = new GIcon(); 
sbdcIcon.image = 'http://wsuwest.wsu.edu/map/markers/sbdc.png';
sbdcIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/sbdc-shadow.png';
sbdcIcon.iconSize = new GSize(16, 13);
sbdcIcon.shadowSize = new GSize(23, 13);
sbdcIcon.iconAnchor = new GPoint(8, 13);
sbdcIcon.infoWindowAnchor = new GPoint(8, 6);

var sbiIcon = new GIcon(); 
sbiIcon.image = 'http://wsuwest.wsu.edu/map/markers/sbi.png';
sbiIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/sbi-shadow.png';
sbiIcon.iconSize = new GSize(20, 28);
sbiIcon.shadowSize = new GSize(35, 28);
sbiIcon.iconAnchor = new GPoint(10, 28);
sbiIcon.infoWindowAnchor = new GPoint(10, 14);

var sirtiIcon = new GIcon();
sirtiIcon.image = "http://wsuwest.wsu.edu/map/markers/sirti.png";
sirtiIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
sirtiIcon.iconSize = new GSize(14, 23);
sirtiIcon.shadowSize = new GSize(26, 23);
sirtiIcon.iconAnchor = new GPoint(7, 23);
sirtiIcon.infoWindowAnchor = new GPoint(7, 11);

var uwbedcIcon = new GIcon();
uwbedcIcon.image = "http://wsuwest.wsu.edu/map/markers/uwbedc.png";
uwbedcIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
uwbedcIcon.iconSize = new GSize(14, 23);
uwbedcIcon.shadowSize = new GSize(26, 23);
uwbedcIcon.iconAnchor = new GPoint(7, 23);
uwbedcIcon.infoWindowAnchor = new GPoint(7, 11);

var uwcIcon = new GIcon(); 
uwcIcon.image = 'http://wsuwest.wsu.edu/map/markers/uwc.png';
uwcIcon.shadow = 'http://wsuwest.wsu.edu/map/markers/uwc-shadow.png';
uwcIcon.iconSize = new GSize(20, 22);
uwcIcon.shadowSize = new GSize(32, 22);
uwcIcon.iconAnchor = new GPoint(10, 22);
uwcIcon.infoWindowAnchor = new GPoint(10, 11);

var wdcIcon = new GIcon();
wdcIcon.image = "http://wsuwest.wsu.edu/map/markers/wdc.png";
wdcIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
wdcIcon.iconSize = new GSize(14, 23);
wdcIcon.shadowSize = new GSize(26, 23);
wdcIcon.iconAnchor = new GPoint(7, 23);
wdcIcon.infoWindowAnchor = new GPoint(7, 11);

var wedaIcon = new GIcon();
wedaIcon.image = "http://wsuwest.wsu.edu/map/markers/weda.png";
wedaIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
wedaIcon.iconSize = new GSize(14, 23);
wedaIcon.shadowSize = new GSize(26, 23);
wedaIcon.iconAnchor = new GPoint(7, 23);
wedaIcon.infoWindowAnchor = new GPoint(7, 11);

var westIcon = new GIcon();
westIcon.image = "http://wsuwest.wsu.edu/map/markers/west.png";
westIcon.shadow = "http://wsuwest.wsu.edu/map/markers/west-shadow.png";
westIcon.iconSize = new GSize(19, 35);
westIcon.shadowSize = new GSize(37, 35);
westIcon.iconAnchor = new GPoint(9, 35);
westIcon.infoWindowAnchor = new GPoint(9, 17);

var wmsIcon = new GIcon();
wmsIcon.image = "http://wsuwest.wsu.edu/map/markers/wms.png";
wmsIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
wmsIcon.iconSize = new GSize(14, 23);
wmsIcon.shadowSize = new GSize(26, 23);
wmsIcon.iconAnchor = new GPoint(7, 23);
wmsIcon.infoWindowAnchor = new GPoint(7, 11);

var wtcIcon = new GIcon();
wtcIcon.image = "http://wsuwest.wsu.edu/map/markers/wtc.png";
wtcIcon.shadow = "http://wsuwest.wsu.edu/map/markers/shadow.png";
wtcIcon.iconSize = new GSize(14, 23);
wtcIcon.shadowSize = new GSize(26, 23);
wtcIcon.iconAnchor = new GPoint(7, 23);
wtcIcon.infoWindowAnchor = new GPoint(7, 11);

var wwuIcon = new GIcon();
wwuIcon.image = "http://wsuwest.wsu.edu/map/markers/wwu.png";
wwuIcon.shadow = "http://wsuwest.wsu.edu/map/markers/wwu-shadow.png";
wwuIcon.iconSize = new GSize(21, 21);
wwuIcon.shadowSize = new GSize(32, 21);
wwuIcon.iconAnchor = new GPoint(10, 21);
wwuIcon.infoWindowAnchor = new GPoint(10, 10);

var customIcons = [];
customIcons["ado"] = adoIcon;
customIcons["campus"] = campusIcon;
customIcons["ctc"] = ctcIcon;
customIcons["cted"] = ctedIcon;
customIcons["cwu"] = cwuIcon;
customIcons["eda"] = edaIcon;
customIcons["edd"] = eddIcon;
customIcons["energy"] = energyIcon;
customIcons["esc"] = escIcon;
customIcons["ewu"] = ewuIcon;
customIcons["extco"] = extcoIcon;
customIcons["farms"] = farmsIcon;
customIcons["ipz"] = ipzIcon;
customIcons["lc"] = lcIcon;
customIcons["pnnl"] = pnnlIcon;
customIcons["port"] = portIcon;
customIcons["rec"] = recIcon;
customIcons["sbdc"] = sbdcIcon;
customIcons["sbi"] = sbiIcon;
customIcons["sirti"] = sirtiIcon;
customIcons["uwbedc"] = uwbedcIcon;
customIcons["uwc"] = uwcIcon;
customIcons["wdc"] = wdcIcon;
customIcons["weda"] = wedaIcon;
customIcons["west"] = westIcon;
customIcons["wms"] = wmsIcon;
customIcons["wtc"] = wtcIcon;
customIcons["wwu"] = wwuIcon;

var markerGroups = { "ado": [], "campus": [], "ctc": [], "cted": [], "cwu": [], "eda": [], "edd": [], "energy": [], "esc": [], "ewu": [], "extco": [], "farms": [],"ipz": [], "lc": [], "pnnl": [], "port": [], "rec": [], "sbdc": [], "sbi": [], "sirti": [], "uwbedc": [], "uwc": [], "wdc": [], "weda": [], "west": [], "wms": [], "wtc": [], "wwu": [], "": []};

var param_nameColumn = "name";
var param_addressColumn = "address";
var param_latColumn = "latitude";
var param_lngColumn = "longitude";
var param_websiteColumn = "website";
var param_phoneColumn = "phone";
var param_contactColumn = "contact";
var param_typeColumn = "type";

function load() {  
  if (GBrowserIsCompatible()) {
    map = new GMap2(document.getElementById("map"));
    map.addControl(new GLargeMapControl());
    map.setCenter(new GLatLng(47.318100, -120.988980), 7, G_PHYSICAL_MAP);
	progressBar = new ProgressbarControl(map);
	map.enableScrollWheelZoom();
	getJSON();
  } else {
    alert("Sorry, the Google Maps API is not compatible with this browser");
  }
}

function loadMarkers(){
  progressBar.start(maxNum);
  setTimeout('loadMapJSON', 10);
}

function markerClicked(markerNum) {
  mapMarkers[markerNum].openInfoWindowHtml(mapHTMLS[markerNum]);
}

function loadMapJSON(json) {
  num++;
  progressBar.updateLoader(1);

  for (var i = 0; i < json.feed.entry.length; i++) {
    var entry = json.feed.entry[i];
    if(entry["gsx$" + param_latColumn]) {
      var lat = parseFloat(entry["gsx$" + param_latColumn].$t);
      var lng = parseFloat(entry["gsx$" + param_lngColumn].$t);
      var point = new GLatLng(lat,lng);    
	  var type = entry["gsx$"+param_typeColumn].$t;
	  var html = "<div style='font-size:12px'>";
      html += "<a href=" + entry["gsx$"+param_websiteColumn].$t + ">" + "<strong>" + entry["gsx$"+param_nameColumn].$t + "</strong></a>";
	  if(entry["gsx$" + param_addressColumn]) {
        html += "<br/>" + entry["gsx$"+param_addressColumn].$t;
      }  
	  if(entry["gsx$" + param_phoneColumn]) {
        html += "<br/>" + entry["gsx$"+param_phoneColumn].$t;
      }
	  if(entry["gsx$" + param_contactColumn]) {
        html += "<br/><a href=mailto:" + entry["gsx$"+param_contactColumn].$t + ">Email</a>";
      }	  
      html += "</div>";

      var marker = createMarker(point,html,type);
      map.addOverlay(marker);
      mapHTMLS.push(html);
    } 
  }
  
  if (num < maxNum) {
    setTimeout('loadMapJSON(json)', 10);
  } else {
    progressBar.remove();
    num = 0;
  }

  hide("ado");
  hide("ctc");
  hide("cted");
  hide("cwu");
  hide("eda");
  hide("edd");
  hide("energy");
  hide("esc");
  hide("ewu");
  hide("extco");
  hide("farms");
  hide("ipz");
  hide("lc");
  hide("pnnl");
  hide("port");
  hide("rec");
  hide("sbdc");
  hide("sbi");
  hide("sirti");
  hide("uwbedc");
  hide("uwc");
  hide("wdc");
  hide("weda");
  hide("wms");
  hide("wtc");
  hide("wwu");
  hide("");
}

function createMarker(point, html, type) {
  var marker = new GMarker(point, customIcons[type]);
    markerGroups[type].push(marker);
  GEvent.addListener(marker, "click", function() {
    marker.openInfoWindowHtml(html);
  });
  return marker;
}

function show(type) {
  for (var i = 0; i < markerGroups[type].length; i++) {
	  markerGroups[type][i].show();
  }
}

function hide(type) {
  for (var i = 0; i < markerGroups[type].length; i++) {
	  markerGroups[type][i].hide();
  }
  map.closeInfoWindow();
}

function boxclick(box,type) {
  if (box.checked) {
	show(type);
  } else {
	hide(type);
  }
}

function getJSON() {
  var script = document.createElement('script');
  script.setAttribute('src', 'http://spreadsheets.google.com/feeds/list/p_pC5wAf--uz3HbhEPOn5VA/od6/public/values?alt=json-in-script&callback=loadMapJSON');
  script.setAttribute('id', 'jsonScript');
  script.setAttribute('type', 'text/javascript');
  document.documentElement.firstChild.appendChild(script);
}

/***********************************************
Drop Down/ Overlapping Content: http://www.dynamicdrive.com
***********************************************/
var dropdowncontent={
	disableanchorlink: true,
 	hidedivmouseout: [true],

	isContained:function(m, e){
		var e=window.event || e
		var c=e.relatedTarget || ((e.type=="mouseover")? e.fromElement : e.toElement)
		while (c && c!=m)try {c=c.parentNode} catch(e){c=m}
		if (c==m)
			return true
		else
			return false
	},

	show:function(anchorobj, subobj, e){
		if (!this.isContained(anchorobj, e) || (e && e.type=="click")){
			var e=window.event || e
			if (e.type=="click" && subobj.style.visibility=="visible"){
				subobj.style.visibility="hidden"
				return
			}
			if (e.type=="click" && subobj.style.display=="block"){
				subobj.style.visibility="none"
				return
			}
			subobj.style.visibility="visible"
			subobj.style.display="block"
			subobj.startTime=new Date().getTime()
			subobj.contentheight=parseInt(subobj.offsetHeight)
			if (typeof window["hidetimer_"+subobj.id]!="undefined")
				clearTimeout(window["hidetimer_"+subobj.id])
			this.slideengine(subobj, (subobj.dropposition[1]=="top")? "up" : "down")
		}
	},

	slideengine:function(obj, direction){
		var elapsed=new Date().getTime()-obj.startTime
		if (elapsed<obj.glidetime){
			var distancepercent=(direction=="down")? this.curveincrement(elapsed/obj.glidetime) : 1-this.curveincrement(elapsed/obj.glidetime)
			var currentclip=(distancepercent*obj.contentheight)+"px"
			window["glidetimer_"+obj.id]=setTimeout(function(){dropdowncontent.slideengine(obj, direction)}, 10)
		}
	},

	hide:function(activeobj, subobj, e){
		if (!dropdowncontent.isContained(activeobj, e)){
			window["hidetimer_"+subobj.id]=setTimeout(function(){
				subobj.style.visibility="hidden"
				subobj.style.display="none"
				clearTimeout(window["glidetimer_"+subobj.id])
			}, dropdowncontent.hidedivmouseout[1])
		}
	},

	hidediv:function(subobjid){
		document.getElementById(subobjid).style.visibility="hidden"
		document.getElementById(subobjid).style.display="none"
	},

 init:function(anchorid, pos, glidetime, revealbehavior){
		var anchorobj=document.getElementById(anchorid)
		var subobj=document.getElementById(anchorobj.getAttribute("rel"))
		var subobjsource=anchorobj.getAttribute("rev")
		if (subobjsource!=null && subobjsource!="")
			this.ajaxconnect(subobjsource, anchorobj.getAttribute("rel"))
		subobj.dropposition=pos.split("-")
		subobj.glidetime=glidetime || 1000
		if (typeof revealbehavior=="undefined" || revealbehavior=="mouseover"){
			anchorobj.onmouseover=function(e){dropdowncontent.show(this, subobj, e)}
			anchorobj.onmouseout=function(e){dropdowncontent.hide(subobj, subobj, e)}
			if (this.disableanchorlink) anchorobj.onclick=function(){return false}
		}
		else
			anchorobj.onclick=function(e){dropdowncontent.show(this, subobj, e); return false}
		if (this.hidedivmouseout[0]==true)
			subobj.onmouseout=function(e){dropdowncontent.hide(this, subobj, e)}
	}
}

function mailpage() {mail_str = "mailto:?subject=Check out " + document.title; mail_str += "&body=I thought you might be interested in " + document.title; mail_str += ". You can view it at " + location.href; location.href = mail_str;}