/**
 * sp(w,h)	-- use client side JavaScript to print out a spacer image pre-akamaized. TPN
 */

function sp(w,h) {
	document.write('<img src="http://a1496.g.akamai.net/7/1496/358/94fb0c3ed8a8f9/www.ef.com/_imgs/ui/trans.gif" width="'+w+'" height="'+h+'" border="0">')
}

var dhtmlmenu = new Array()
var destlist  = new Array()

dhtmlmenu.initialise = function(selectedcolour, linkstyle, prod) {
	this.selectedcolour	= ' '+selectedcolour;
	this.linkstyle		= linkstyle;
	this.prod			= prod;
}

dhtmlmenu.p = function(url, label, parent, selected) {

	this[this.length] = {
		'url':		url,
		'label':	label,
		'parent':	parent,
		'selected':	selected
	}
}

dhtmlmenu.toString = function() {
	var str = '<table width="140" cellpadding="0" cellspacing="0" border="0">\n'
	for (i=0; i<this.length; i++) {
		if (this[i].parent==1) {
			str += '<tr><td colspan="3">&nbsp;</td></tr>\n'
			if (this[i].url != "" && this[i].url != "undefined") {
				str += '<tr><td valign="top" width="15">&nbsp;<a href="'+this[i].url+'" class="'+this.linkstyle+'">'+(this[i].selected==1?'&#150':'&#43')+'</a>&nbsp;</td>'
					+ '<td colspan="2"><a href="'+this[i].url+'" class="'+this.linkstyle+'">'
					+ '<b>'+this[i].label+'</b>'
					+ '</a></td></tr>\n'
			} else {
				str += '<tr'+(this[i].selected==1?this.selectedcolour:'')+'>'
				str += '<td>&nbsp;</td><td valign="top" colspan="2">'
					+ '<a class="'+this.linkstyle+'"><b>' + this[i].label+'</b></a>'
					+ '</td></tr>\n'
			}
		} else {
			if (this[i].url != "" && this[i].url != "undefined") {
				str += '<tr><td valign="top"></td><td valign="top"><a href="'+this[i].url+'" class="'+this.linkstyle+'">&gt;</a></td>'
					+ '<td><a href="'+this[i].url+'" class="'+this.linkstyle+'">' + this[i].label
					+ '</a></td></tr>\n'
			} else {
				str += '<tr'+(this[i].selected==1?this.selectedcolour:'')+'>'
				str += '<td>&nbsp;</td><td valign="top">' + '<img src="/_imgs/core/'+this.prod+'_arrow.gif">'
					+ '</td><td>' + this[i].label
					+ '</td></tr>\n'
			}
		}
	}
	return str+'</table><br>\n';
}

destlist.initialise = function(prod) {
	this.prod			= prod;
	this.ver	= navigator.appVersion;
	this.agent	= navigator.userAgent;
	this.dom	= (document.getElementById ? 1 : 0);
	this.opera5	= (this.agent.indexOf("Opera 5") > -1);
	this.ie5	= ((this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5) ? 1 : 0); 
	this.ie6	= ((this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5) ? 1 : 0);
	this.ie4	= ((document.all && !this.dom && !this.opera5) ? 1 : 0);
	this.ie		= (this.ie4 || this.ie5 || this.ie6);
	this.mac	= (this.agent.indexOf("Mac") > -1);
	this.ns6	= ((this.dom && parseInt(this.ver) >= 5) ? 1 : 0); 
	this.ns4	= ((document.layers && !this.dom) ? 1 : 0);
}

destlist.p = function(value, label, parent) {

	this[this.length] = {
		'value':	value,
		'label':	label,
		'parent':	parent
	}
}

function switchto(def) {
	if(def!="") {
		window.location.href=def;
	}
}


function jumpPage(newLoc) {
	newPage = newLoc.options[newLoc.selectedIndex].value
	if (newPage != "") {
		window.parent.location = newPage
	}
}

destlist.toString = function() {
	var str = ''
	str+='<table><form><tr><td align="center">';
	str+='<select class="'+this.prod+'destdown" '+(this.ie ? (this.mac ? 'style="width:124px" ' : 'style="width:134px" ') : '')+'name="sel" onchange="switchto(this.options[this.selectedIndex].value)">\n';

	for (i=0; i<this.length; i++) {
		str += '<option '+(this[i].parent == 1 ? 'class="'+this.prod+'desthead"' : 'class="'+this.prod+'destination"')+' value="'+this[i].value+'">'+this[i].label+'</option>\n'
	}

	return str+'</select></td></form></tr></table>\n';
}

function expandcollapse (postid) { 
   var whichpost = document.getElementById(postid); 
   if ( whichpost.className=="postshown" ) { whichpost.className="posthidden"; } 
   else { whichpost.className="postshown"; }   
}

function expand (postid) { 
   var whichpost = document.getElementById(postid); 
   whichpost.className="postshown";   
}

function collapse (postid) { 
   var whichpost = document.getElementById(postid); 
   whichpost.className="posthidden";   
}  