if(document.layers){
	yg_onResizeNS4.w=innerWidth;yg_onResizeNS4.h=innerHeight;
	if(document.embeds.length>0)setInterval("yg_onResize()",200);
	else onresize=yg_onResizeNS4;
}else if((navigator.userAgent.indexOf("Mac")!=-1)&&(document.all)){
	onresize=yg_onResizeMacIE;
}
function yg_onResizeNS4(){
	if(w!=innerWidth||h!=innerHeight)location.reload();
}
function yg_onResizeMacIE(){
	location.reload();
}
function yg_onResizeNS6(){
	location.reload();
}

function ylib_Browser() {
 d=document;
 this.agt=navigator.userAgent.toLowerCase();
 this.major = parseInt(navigator.appVersion);
 this.dom=(d.getElementById)?1:0; // true for ie6, ns6
 this.ns=(d.layers);
 this.ns4=(this.ns && this.major == 4);
 this.ns4up=(this.ns && this.major >=4);
 this.ns6=(this.dom&&navigator.appName=="Netscape");
 this.op=(window.opera? 1:0);
 this.op6= ((this.agt.indexOf("opera 6") > 0) || (this.agt.indexOf("opera/6") > 0));
 this.ie=(d.all);
 this.ie4=(d.all&&!this.dom)?1:0;
 this.ie4up=(this.ie && this.major >= 4);
 this.ie5=(d.all&&this.dom &&  navigator.userAgent.match(/MSIE 5/));
 this.ie6=(d.nodeType)? 1:0;
 this.sf=(this.agt.indexOf("safari")!=-1);
 this.win=((this.agt.indexOf("win")!=-1) || (this.agt.indexOf("16bit")!=-1));
 this.mac=(this.agt.indexOf("mac")!=-1);
}
var oBw = new ylib_Browser();

function yg_popup(u,n,w,h,k){
        var a=[],o=null,r=arguments;
        a[0]="width="+w+",height="+h;
        a[1]=",scrollbars="+((k&1)?1:0);
        a[2]=",resizable="+((k&2)?1:0);
        a[3]=",toolbar="+((k&4)?1:0);
        a[4]=",status="+((k&8)?1:0);
        a[5]=",location="+((k&16)?1:0);
        a[6]=",menubar="+((k&32)?1:0);
        if(r.length>=6){a[7]=(document.layers)?",screenX="+r[5]:",left="+r[5]}
        if(r.length>=7){a[8]=(document.layers)?",screenY="+r[6]:",top="+r[6]}
        a=a.join("");o=open(u,n,a);o.focus();
        return o;
}

function setFL(field) {
	var val=field.options[field.selectedIndex].value;
	if(val=="Use Address Below") {
		document.mapForm2.addr.value=""
		document.mapForm2.csz.value=""
		return
	}
	var keyValue=val.split("")
	if(keyValue.length < 2) {
		document.mapForm2.addr.value=""
		document.mapForm2.csz.value=""
	}
	var addrArray=keyValue[1].split("");
	if(addrArray[0]&&addrArray[0] != "") {
		document.mapForm2.addr.value=addrArray[0]
		if ( addrArray[0] != keyValue[0] ) 
			document.mapForm2.name.value=keyValue[0]
		else
			document.mapForm2.name.value="";
	}
else {
document.mapForm2.addr.value=""
}
if(addrArray[1]&&addrArray[1] != "") {
document.mapForm2.csz.value=addrArray[1]
}
else {
document.mapForm2.csz.value=""
}
if(addrArray[2]&&addrArray[2]=="ca") {
document.mapForm2.country.selectedIndex=1
}
else if(addrArray[2]&&addrArray[2]=="fr") {
document.mapForm2.country.selectedIndex=2
}
else if(addrArray[2]&&addrArray[2]=="de") {
document.mapForm2.country.selectedIndex=3
}
else if(addrArray[2]&&addrArray[2]=="it") {
document.mapForm2.country.selectedIndex=4
}
else if(addrArray[2]&&addrArray[2]=="sp") {
document.mapForm2.country.selectedIndex=5
}
else if(addrArray[2]&&addrArray[2]=="uk") {
document.mapForm2.country.selectedIndex=6
}
else {
document.mapForm2.country.selectedIndex=0
}
if ( addrArray[3]&&addrArray[3]!= "" ) {
var llValue=addrArray[3].split("")
  if(llValue.length == 2) {
     document.mapForm2.lat.value=llValue[0]
     document.mapForm2.lon.value=llValue[1]
     document.mapForm2.qty.value="12"
  }
}
}
function setCSZ(field) {
var val=field.options[field.selectedIndex].value;
if(val && val != "") {
document.mapForm2.csz.value=val;
}
else {
document.mapForm2.csz.value=""
}
}

function sCookie(sValue) { 
var today = new Date();
var expiry = new Date(today.getTime() + 3650 * 24 * 60 * 60 * 1000); // plus 150 days
document.cookie="YMAP=&Z=" + sValue + "; expires=" + expiry.toGMTString() + "; domain=maps.yahoo.com";
}

function c_ad_click(cat, rd) {
    if (mpoi_is_supported()) {
	var node = document.getElementById(cat);
	if (node) { 
	    node.checked = 1; 
	    var form = node.form;
	    form.rezoom.value = 1;
	    form.action = rd + form.action;
	    form.submit();
	    return false;
	}
    }
    return true;
}
