/* ---------------------------------------------------------------
   Copyright © 2010, ECO Services International
   --------------------------------------------------------------- */

if(top == self) sfc(unescape(window.location.pathname));

function sfc(p) {
	p = p.replace(/\\/g,"\/");
	this.name = p.substr(p.lastIndexOf("\/") + 1);
	window.location.href = "index.htm";
}

var popwin;
function map() {
	var WinX = 500;
	var WinY = 300;
	if(popwin) {
		if(!popwin.closed) popwin.close();
	}
	popwin = window.open("map.html","PopWin","dependent=yes,scrollbars=no,resizable=no,width=" + WinX + ",height=" + WinY + ",left=" + ((screen.availWidth-20)-WinX) + ",top=20");
}

function vid(t,n) {
	switch (t) {
		case 1:
			var WinX = 560; var WinY = 340; var p = "vc1.html";
			break;
		case 2:
			var WinX = 512; var WinY = 322; var p = "vc2.html";
			break;
		default:
			var WinX = 425; var WinY = 344; var p = "vc1.html";
			break;
	}
	if(popwin) {
		if(!popwin.closed) popwin.close();
	}
	pvc = n;
	popwin = window.open(p,"PopWin","dependent=yes,scrollbars=no,resizable=no,width=" + WinX + ",height=" + WinY + ",left=" + ((screen.availWidth-20)-WinX) + ",top=20");
}

function mai() {
	var i = window.location.href;
	i = i.substr((i.lastIndexOf("/")+1));
	i = i.substr(0,(i.lastIndexOf(".")));
	var n = document.title;
	if (i == '00777') window.location.href = "../dir/enq.html";
	else {
		parent.name = i + "|" + n;
		window.location.href = "../dir/rfi.html";
	}
}

function CreHlT(i) {
	if (document.createElement) {
		var e = document.createElement("div");
		e.id = i;
		e.className = "hlt"
		e.innerHTML = "&nbsp;";
		document.body.appendChild(e);
	}
}

function CreHlM(i) {
	if (document.createElement) {
		var e = document.createElement("div");
		e.id = i;
		e.className = "hlt"
		e.innerHTML = "&nbsp;";
		document.body.appendChild(e);
		if (e.addEventListener) e.addEventListener("mouseout", hmOff, false);
		else if (e.attachEvent) e.attachEvent("onmouseleave", hmOff);
	}
}

function PosHlt(e) {
	var mX = (ie) ? event.clientX+ie.scrollLeft+12 : e.pageX+12;
	var mY = (ie) ? event.clientY+ie.scrollTop+8 : e.pageY+8;
	var oY = (ie) ? ie.scrollTop : window.pageYOffset;
	var d = document.getElementById("HlT");
	d.style.left = ((wW - mX) < dW) ? (wW - (dW + 24)) + "px" : mX + "px";
	d.style.top = ((dH + mY) > (wH + oY)) ? (mY - 16 - dH) + "px" : mY + "px";
}

function hla(e) {
	if (!e) var e = window.event;
	if (e.target) var t = this.parentNode.getElementsByTagName("ins")[0].innerHTML;
	else if (e.srcElement) var t = e.srcElement.parentNode.getElementsByTagName("ins")[0].innerHTML;
	if (!document.getElementById("HlT")) CreHlT("HlT");
	var d = document.getElementById("HlT");
	d.innerHTML = t;
	d.style.display = "block";
	dW = d.offsetWidth;
	dH = d.offsetHeight;
	ie = (document.all && navigator.userAgent.indexOf("Opera")==-1) ? ((document.documentElement.clientHeight) ? document.documentElement : document.body) : false;
	wW = (ie) ? ie.clientWidth : window.innerWidth-16;
	wH = (ie) ? ie.clientHeight : window.innerHeight;
	document.onmousemove = PosHlt;
}

function hlc(e) {
	if (!e) var e = window.event;
	if (e.target) var t = e.target.toString();
	else if (e.srcElement) var t = e.srcElement.toString();
	t = t.substring((t.lastIndexOf("/")+1));
	t = "i" + t.replace(/.html/, "").replace(/\./, "_");
	if (!document.getElementById("HlT")) CreHlT("HlT");
	if (document.getElementById("HlM")) document.getElementById("HlM").style.display = "none";
	var d = document.getElementById("HlT");
	d.innerHTML = eval(t);
	d.style.display = "block";
	dW = d.offsetWidth;
	dH = d.offsetHeight;
	ie = (document.all && navigator.userAgent.indexOf("Opera")==-1) ? ((document.documentElement.clientHeight) ? document.documentElement : document.body) : false;
	wW = (ie) ? ie.clientWidth : window.innerWidth-16;
	wH = (ie) ? ie.clientHeight : window.innerHeight;
	document.onmousemove = PosHlt;
}

function hlt(e,t) {
	if (!document.getElementById("HlT")) CreHlT("HlT");
	var d = document.getElementById("HlT");
	d.innerHTML = t;
	d.style.display = "block";
	dW = d.offsetWidth;
	dH = d.offsetHeight;
	ie = (document.all && navigator.userAgent.indexOf("Opera")==-1) ? ((document.documentElement.clientHeight) ? document.documentElement : document.body) : false;
	wW = (ie) ? ie.clientWidth : window.innerWidth-16;
	wH = (ie) ? ie.clientHeight : window.innerHeight;
	document.onmousemove = PosHlt;
}

function hlOff() {
	document.getElementById("HlT").style.display = "none";
}

function hli(e) {
	if (!e) var e = window.event;
	var t = (e.target) ? this.toString() : (e.srcElement.nodeName=='IMG') ? e.srcElement.parentNode.toString() : e.srcElement.toString();
	t = t.substring((t.lastIndexOf("/")+1));
	t = "c" + t.replace(/.html/, "");
	if (!document.getElementById("HlM")) CreHlM("HlM");
	var d = document.getElementById("HlM");
	d.innerHTML = eval(t);
	d.style.display = "block";
	dW = d.offsetWidth;
	dH = d.offsetHeight;
	ie = (document.all && navigator.userAgent.indexOf("Opera")==-1) ? ((document.documentElement.clientHeight) ? document.documentElement : document.body) : false;
	wW = (ie) ? ie.clientWidth : window.innerWidth-16;
	wH = (ie) ? ie.clientHeight : window.innerHeight;
 	var mX = (ie) ? event.clientX+ie.scrollLeft+12 : e.pageX+12;
	var mY = (ie) ? event.clientY+ie.scrollTop+8 : e.pageY+8;
	var oY = (ie) ? ie.scrollTop : window.pageYOffset;
	d.style.left = ((wW - mX) < dW) ? (wW - (dW + 24)) + "px" : mX + "px";
	d.style.top = ((dH + mY) > (wH + oY)) ? (mY - 16 - dH) + "px" : mY + "px";
}

function hmOff(e) {
	if ((!document.all) || (document.all && navigator.userAgent.indexOf("Opera")!=-1)) {
		var t = e.target;
		if (t.nodeName != 'DIV') return;
		var r = (e.relatedTarget) ? e.relatedTarget : e.toElement;
		while (r != t && r.nodeName != 'BODY') r = r.parentNode;
		if (r == t) return;
	}
	document.getElementById("HlM").style.display = "none";
}

function LoaHlx(x) {
	var a = document.getElementById(x).getElementsByTagName("a");
	for (var i=0; i<a.length; i++) {
		if (a[i].addEventListener) {
			a[i].addEventListener("mouseover", eval(x), false);
			a[i].addEventListener("mouseout", hlOff, false);
		}
		else if (a[i].attachEvent) {
			a[i].attachEvent("onmouseover", eval(x));
			a[i].attachEvent("onmouseout", hlOff);
		}
	}
}

function LoaHli() {
	var a = document.getElementById("hli").getElementsByTagName("a");
	for (var i=0; i<a.length; i++) {
		if (a[i].addEventListener) a[i].addEventListener("mouseover", hli, false);
		else if (a[i].attachEvent) a[i].attachEvent("onmouseover", hli);
	}
}

function LoaHlr() {
	var a = document.getElementById("hlr").getElementsByTagName("a");
	for (var i=0; i<a.length; i++) {
		if (a[i].parentNode.nodeName=='LI') {
			if (a[i].addEventListener) {
				a[i].addEventListener("mouseover", hlc, false);
				a[i].addEventListener("mouseout", hlOff, false);
			}
			else if (a[i].attachEvent) {
				a[i].attachEvent("onmouseover", hlc);
				a[i].attachEvent("onmouseout", hlOff);
			}
		}
		else {
			if (a[i].addEventListener) a[i].addEventListener("mouseover", hli, false);
			else if (a[i].attachEvent) a[i].attachEvent("onmouseover", hli);
		}
	}
}

var popwin = null;
function PopWin(DocID,WinX,WinY,WinP){
	if(popwin) {
		if(!popwin.closed) popwin.close();
	}
	var sX = (top.screenLeft) ? top.screenLeft : top.screenX;
	var sY = (top.screenTop) ? (top.screenTop-64) : top.screenY;
	if (window.outerWidth) var wX = top.window.outerWidth;
		else if (document.body.offsetWidth) var wX = top.document.body.offsetWidth;
	if (window.outerHeight) var wY = top.window.outerHeight;
		else if (document.all) var wY = (document.documentElement.clientHeight) ? top.document.documentElement.clientHeight : top.document.body.offsetHeight;
	switch(WinP) { 
		case "w":	//centered in opener window
			var popwin = window.open(DocID,"PopUpWin","dependent=1,scrollbars=1,width=" + WinX + ",height=" + WinY + ",left=" + (((wX/2)-(WinX/2))+sX) + "px,top=" + (((wY/2)-(WinY/2))+sY) + "px");
		break;
		default:	//centered in screen
			popwin = window.open(DocID,"PopUpWin","dependent=1,scrollbars=1,width=" + WinX + ",height=" + WinY + ",left=" + ((screen.availWidth/2)-(WinX/2)) + ",top=" + ((screen.availHeight/2)-(WinY/2)));
		break;
	}
}

function aci(e) {
	var e = e.srcElement || e.target;
	e = e.parentNode.parentNode;
	var d = e.getElementsByTagName("SPAN");
	d = "DTSTART:" + d[0].innerHTML.replace(/-/g,"") + "\n";
	var l = e.getElementsByTagName("A");
	l = "URL;VALUE=URI:" + l[0].href + "\n";
	var s = "BEGIN:VCALENDAR\nVERSION:2.0\nPRODID:-//EcoWeb//NONSGML v1.0//EN\nBEGIN:VEVENT\n";
	for (var i = 0; i < e.childNodes.length; i++) {
		if (e.childNodes[i].className == "evt") {
			var t =  e.childNodes[i].innerHTML.replace(/\&amp;/g,"and");
			s += "SUMMARY:" + t.replace(/ \u221e/,"") + "\n" + d;
		}
		if (e.childNodes[i].className == "evl") {
			var t =  e.childNodes[i].innerHTML.replace(/\&amp;/g,"and");
			s += "LOCATION:" + t.replace("Location:&nbsp;","") + "\n";
		}
		if (e.childNodes[i].className == "evd") s += "DESCRIPTION:" + e.childNodes[i].innerHTML.replace(/\&amp;/g,"and") + "\n" + l;
	}
	s += "END:VEVENT\nEND:VCALENDAR\n";
	s = encodeURI(s);
	var h = "http://www.eco-web.com/eve/ics.php?e=";
	window.location.href = h + s;
}

function acg(e) {
	var e = e.srcElement || e.target;
	e = e.parentNode.parentNode;
	var d = e.getElementsByTagName("SPAN");
	d = d[0].innerHTML.replace(/-/g,"");
	d = "&dates=" + d + "/" + d;
	var l = e.getElementsByTagName("A");
	l = "&trp=true&sprop=" + l[0].href + "&sprop=name:Official Website";
//	l = "sprop=" + l[0].href + "&sprop=name:Official Website";
	var s = "http://www.google.com/calendar/event?action=TEMPLATE";
	for (var i = 0; i < e.childNodes.length; i++) {
		if (e.childNodes[i].className == "evt") {
			var t =  e.childNodes[i].innerHTML.replace(/\&amp;/g,"and");
			s += "&text=" + t.replace(/ \u221e/,"") + d;
		}
		if (e.childNodes[i].className == "evl") {
			var t =  e.childNodes[i].innerHTML.replace(/\&amp;/g,"and");
			s += "&location=" + t.replace("Location:&nbsp;","");
		}
		if (e.childNodes[i].className == "evd") s += "&details=" + e.childNodes[i].innerHTML.replace(/\&amp;/g,"and") + "\n" + l;
	}
	s = encodeURI(s);
	window.open(s);
}

google_ad_client = "pub-9467312996761334";
google_ad_type = "text_image";
google_page_url = document.location;
google_color_bg = "005040";
google_color_border = "005040";
google_color_link = "FFC040";
google_color_text = "F0F0F0";
google_color_url = "50F0B0";
google_ad_width = 160;
google_ad_height = 600;
google_ad_format = "160x600_as";
