<!--  common code only: js1.3 or ECMA 262 compliant
self.name="eeo_parent";
var name = navigator.appName
var ss = "oth";
var dom = (document.getElementById) ? true : false;
var ns4 = (document.layers) ? true : false;
var ie = (document.all) ? true : false;
var ie4 = ie && !dom;
var mac = (navigator.appVersion.indexOf("Mac") != -1);
var ie4mac =  ie4 && mac;
var opera = (navigator.userAgent.indexOf("Opera")!=-1);
ss = (ns4|ie4|ie4mac) ? "oth2" :  "dom2" ;

var today = new Date();
var thisyear = today.getFullYear();


// Preload the dividers
if (document.images) {
	dots = new Image();
	dots.src= "/icons/div_dots.gif";
	blackdots= new Image();
	blackdots.src= "/icons/div_dots3_vertical.gif";
	lines = new Image();
	lines.src = "/icons/div_lines.gif";
}

//original stylesheet for handbooks:
var url=new String(self.location.pathname);
if(    url.indexOf("/handbooks/") != -1    ) {
	ss = ss + '_handbooks';
} 
if(    url.indexOf("/ers/") != -1 ) {
    ss = ss + '_ers';  
}

//alert(ss);
document.write('<link rel="stylesheet" href="/_css/' + ss + '.css">');

if (ns4) {
   origWidth = innerWidth;
   origHeight = innerHeight;
   onresize = "if(innerWidth!=origWidth||innerHeight!=origHeight) location.reload()";
 }

// not using menus in this round of Earthnet Online
//if(dom) {
//	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.3' SRC='/_js/menu_dom.js' TYPE='text/javascript'><\/SCR" + "IPT>");
//} else {
//	document.write("<SCR" + "IPT LANGUAGE='JavaScript1.3' SRC='/_js/menu_oth.js' TYPE='text/javascript'><\/SCR" + "IPT>");
//}


function recolor(me) {
	if( !document.getElementById ) { return; }	//non-DOM browser
	var nm=me.id;
	var len = nm.length - 1 ;
	var n=nm.charAt(len); 

	var styleNm='menuitemblack';
	var styleNmAkt='menuitemblackakt';
	var dot_r=dots.src;
	var dot_l=dots.src;
	var line=lines.src;

	if(nm.indexOf("ms") == 0 ) {
		styleNm='misioff';
		styleNmAkt='mision';
		//dot_r=blackdots.src;
		//dot_l=blackdots.src;
		//if(n==3) { dot_l=lines.src; dot_r=lines.src; }
//alert("len is " + len + " n is " +  n );  // earth.esa.int expects ERS as active (id=2,3)
// envisat.esa.int has its own common2.js - ENVISAT as active (id=1,2)
	}

//alert(window.location.pathname);

	var strTd=nm + '_td';
	var strLeftIm=nm + '_im';
	var r=nm.substring(0,len);

	n = (n*1)+1;
	strRghtIm = r + n + '_im';

//alert("strLeftIm is " + strLeftIm + " strRghtIm is " +  strRghtIm);


	var tdObj;
	if( document.getElementById ) {
		tdObj=document.getElementById(strTd);
		if ( document.getElementById(strTd) !=null ) {
			if (me.className==styleNm) {
				me.className=styleNmAkt;
				tdObj.className=styleNmAkt;
			//alert(document[strRghtIm] + " " +  strRghtIm   );
				//document[strLeftIm].src = line;
				//document[strRghtIm].src = line;

			} else {
				me.className=styleNm;
				tdObj.className=styleNm;
				//document[strLeftIm].src = dot_l;
				//document[strRghtIm].src = dot_r;
			}
		}

	}
}




function jumpto(which) {
  self.location.href = which;
}

function contactus() {
	var fb='/cgi-bin/contactus?' + self.location.href;
	self.location.href = fb;
}

function srch(url,wth) {
        if(wth==null) wth=400;
        if(srchwnd) {
                srchwnd.location=url;
        } else {
        var srchwnd=window.open(url, 'Srch','width='+wth+',height=400,status=1,toolbar=0,location=0,directories=0,scrollbars=1,resizable=1,copyhistory=0');
        }
        if(srchwnd) srchwnd.focus();
}

function qs(words) {
alert('qs');
   re = / /gi;
   var wds=words.replace(re, "+");
	if( wds.indexOf("+") != -1 ) {
		wds='"' + wds + '"';
	}
   var url='/cgi-bin/htsearch?&words='+wds;

   var where=self.location.host;
   var to=self.location.host.indexOf('.');
   if(to>0)  where=self.location.host.substr(0,to);
   //if(where != 'earth') { url += '\&restrict='+where; }
   if(where != 'earth2') { url += '\&restrict='+self.location.host; }

	self.location=url;
}


function ct(who,where) {
    self.location.href='mailto:'+who+'@'+where;
}
function ow(which,w,h) {
    if(!w) w=600; if(!h) h=400;
    var how='toolbars=0,status=0,width='+w+',height='+h+',resizable=1,scrollbars=1';
    if(ownd) {
        ownd.location=which;
    } else {
        var ownd=window.open(which,'',how);
    }
    if(ownd) ownd.focus();
}




// -->

