var isMinNS4 = (navigator.appName.indexOf("Netscape") >= 0 && parseFloat(navigator.appVersion) >= 4) ? 1 : 0;
var isMinNS6 = (isMinNS4 && navigator.userAgent.indexOf("Gecko")>=0) ? 1 : 0;
var isMinIE4 = (document.all) ? 1 : 0;
var isMinIE5 = (isMinIE4 && navigator.appVersion.indexOf("5.")) >= 0 ? 1 : 0;
var isDOM = (document.getElementById) ? 1 : 0;
function hideLayer(l) {if (isMinIE4||isDOM) l.style.visibility = "hidden"; if (isMinNS4)l.visibility = "hide";}
function showLayer(l) {if (isMinIE4||isDOM)l.style.visibility = "visible";if (isMinNS4) l.visibility = "show";}
function moveLayerTo(l, x, y) {if (isMinIE4||isDOM) {l.style.left = x + "px"; l.style.top  = y + "px";return;}if (isMinNS4)l.moveTo(x, y);}
function getPageLeft(l) {if (isMinIE4||isDOM) return(l.offsetLeft);if (isMinNS4) return(l.pageX);return(-1);}
function getPageTop(l) {if (isMinIE4||isDOM) return(l.offsetTop);if (isMinNS4) return(l.pageY);return(-1);}
function getWidth(l) {if (isDOM){if (l.style.width)return(parseInt(l.style.width));else return(l.clientWidth);}if (isMinIE4) {if (l.style.pixelWidth) return(l.style.pixelWidth); else return(l.clientWidth);}if (isMinNS4) {if (l.width) return(l.width); else return(l.clip.right - l.clip.left);} return(-1);}
function getHeight(l) {if (isDOM){if (l.style.height) return(parseInt(l.style.height)); else return(l.clientHeight);} if (isMinIE4) {if (false && l.style.pixelHeight) return(l.style.pixelHeight); else return(l.clientHeight);} if (isMinNS4) {if (l.height) return(l.height); else return(l.clip.bottom - l.clip.top);} return(-1);}
function getLayer(name) {if (isDOM) return document.getElementById(name);if (isMinNS4) return findLayer(name, document);if (isMinIE4) return eval('document.all.' + name); return null;}
function findLayer(name, doc) {var i, l;for (i = 0; i < doc.layers.length; i++) {l = doc.layers[i];if (l.name == name) return l;if (l.document.layers.length > 0) {l = findLayer(name, l.document);if (l != null) return l;}} return null;}
function getImage(name) {if (isDOM) return document.getElementById(name); if (isMinNS4) {return findImageNS(name, document);} if (isMinIE4) return eval('document.all.' + name); return null;}
function findImageNS(name, doc) {var i, img;for (i = 0; i < doc.images.length; i++) if (doc.images[i].name == name) return doc.images[i];for (i = 0; i < doc.layers.length; i++) if ((img = findImage(name, doc.layers[i].document)) != null) {img.container = doc.layers[i]; return img;}  return null;}
function getImagePageLeft(img) {var x, obj;if (isMinNS4) {if (img.container != null) return img.container.pageX + img.x; else  return img.x;} if (isMinIE4||isDOM) {x = 0;obj = img; while (obj.offsetParent != null) {x += obj.offsetLeft;obj = obj.offsetParent;}x += obj.offsetLeft;return x;} return -1;}
function getImagePageTop(img) { var y, obj;if (isMinNS4) {if (img.container != null) return img.container.pageY + img.y; else return img.y;}if (isMinIE4||isDOM) {y = 0;obj = img;while (obj.offsetParent != null) {y += obj.offsetTop;obj = obj.offsetParent;}y += obj.offsetTop; return y;}return -1;}
function showActiveImg (activeobj) {if (activeobj!=window.curActiveImg && activeobj.src.indexOf("_s")==-1) {window.curActiveImg = activeobj;window.oldActiveImgSrc = activeobj.src;activeobj.src = activeobj.src.replace(".jpg","_s.jpg");}}
function hideActiveImg (){if (window.curActiveImg != null){window.curActiveImg.src = window.oldActiveImgSrc;window.curActiveImg = null;}}
function reloadPage(init) {if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }} else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();}
function dummy() {return;}
function displayLayer (layer)  {if (isMinNS4) layer.visibility = "show";if (isMinIE4) layer.style.display = "inline";}
function removeLayer (layer)  {if (isMinNS4) layer.visibility = "hide";if (isMinIE4) layer.style.display = "none";}
function isVisible(layer) {if ((isMinIE4||isDOM) && layer.style.visibility == "visible"  || layer.style.display!="none") return(true);if (isMinNS4 && layer.visibility == "show") return(true);return(false);}
function preload() {var d=document;if(d.images) {if(!d.MM_p) d.MM_p=new Array();var i,j=d.MM_p.length,a=preload.arguments;for(i=0; i<a.length; i++) if (a[i].indexOf("#")!=0){d.MM_p[j]=new Image; d.MM_p[j++].src="img/"+a[i];}}}
function nxSetImgBorders() {var d=document.images;if(d) {for(i=0; i<d.length; i++) d[i].style.border=0;}}

function initPage(host)
{
	changeExternalLinks(host);
}

// all outgoing links in a new window
function changeExternalLinks(host)
{
	for (var i=0; i<=(document.links.length-1); i++)
	{
		if ((document.links[i].href.indexOf("http://www.")!=-1) && (document.links[i].href.indexOf(host)==-1))
			document.links[i].target = "_new";
	}			
}
function showWindow(url,options)
{
	if (options.length==0)
	{
		intwidth = screen.width / 2;
		intheight = screen.height / 2;
		options = "toolbar=no,location=no,directories=no,menubar=no,status=no,resizable=yes,scrollbars=yes,titlebar=yes,width="+intwidth+",height="+intheight+",top=0,left=0";
	}
	window.open (url,'',options,true);
	if (event!=null)
		event.returnValue = false;
}

function printWindow(url,options)
{
	if (options.length==0)
	{
		intwidth = (screen.width / 2)+50;
		intheight = screen.height / 2;
		options = "toolbar=no,location=no,directories=no,menubar=no,status=no,resizable=yes,scrollbars=yes,titlebar=yes,width="+intwidth+",height="+intheight+",top=0,left=0";
	}
	wnd=window.open (url,'',options,true);
	wnd.print();
	if (event!=null)
		event.returnValue = false;
}


