function fnOpenWindow(url,parameters)
{
	var aParameters=parameters.split(',');
	var data=new Array();
	for (var i=0;i<aParameters.length;i++)
	{
		var pr=aParameters[i];
		var key = pr.substr(0,pr.indexOf('='));
		var value=pr.substr(pr.indexOf('=')+1);
		data[key]=value;
	}



	if ( (data['hposition'])&&(data['width'])&&(data['hposition']!='system') )
	{
		var posX=null;
		if (data['hposition']=='left')
		{
			posX=0;
		}
		if ( (window.screen)&&(window.screen.availWidth) )
		{
			if (data['hposition']=='center')
				posX=(window.screen.availWidth-data['width'])/2;
			if (data['hposition']=='right')
				posX=window.screen.availWidth-data['width'];
		}

		if (posX!=null)
			parameters+=",left="+parseInt(posX);
	}

	if ( (data['vposition'])&&(data['height'])&&(data['vposition']!='system') )
	{
		var posY=null;
		if (data['vposition']=='top')
		{
			posY=0;
		}
		if ( (window.screen)&&(window.screen.availHeight) )
		{
			if (data['vposition']=='center')
				posY=(window.screen.availHeight-data['height'])/2;
			if (data['vposition']=='bottom')
				posY=window.screen.availHeight-data['height'];
		}

		if (posY!=null)
			parameters+=",top="+parseInt(posY);
	}


	var oWnd=window.open(url,'',parameters);
	oWnd.focus();
}



var n,i,li,ul,init,z,zul;

function initMenu() {
    if (document.getElementById("nav")){
    	n = document.getElementById("nav");
    	ul = n.getElementsByTagName("UL"); zul = 199;
		li = n.getElementsByTagName("LI"); z = 999;
		for (i=0; i<ul.length; i++) {
			ul[i].style.zIndex=zul; zul--;			
		}
		for (i=0; i<li.length; i++) {			
			li[i].style.zIndex = z; z--;
			li[i].onmouseover=function() {
				this.className+=(this.className.length>0? " ": "") + "hover";
			}
			li[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp("( ?|^)hover\\b"), "");
			}
		}
	}
	if (document.getElementById("nav2")){
    	n = document.getElementById("nav2");
    	ul = n.getElementsByTagName("UL"); zul = 199;
		li = n.getElementsByTagName("LI"); z = 999;
		for (i=0; i<ul.length; i++) {
			ul[i].style.zIndex=zul; zul--;			
		}
		for (i=0; i<li.length; i++) {			
			li[i].style.zIndex = z; z--;
			li[i].onmouseover=function() {
				this.className+=(this.className.length>0? " ": "") + "hover";
			}
			li[i].onmouseout=function() {
				this.className=this.className.replace(new RegExp("( ?|^)hover\\b"), "");
			}
		}
	}
}

function initLinks(tagName)
{
	if (!document.getElementsByTagName)
		return;

	var allA = document.getElementsByTagName(tagName);
	for (var i=0;i<allA.length;i++) {
		//bookmarks
		var sRel=allA[i].rel;
		if (!sRel)
			sRel=allA[i].getAttribute('rel');

		if (sRel == "bookmark") {
			allA[i].onclick = function(evt) {
				if ((evt)&&(evt.ctrlKey))
					return;
				window.open(this.href);
				return false;
			}
		}
	}
}

var searchCleared;
function initSearchField() {
	if(document.getElementById('fullText')) {
		document.getElementById('fullText').onfocus = function () {
			if(!searchCleared) {
				this.value = '';
			}
			searchCleared = true;
		}
	}
}

init = function() {
	if(document.all)
		initMenu();
	initLinks('a');
	initLinks('area');
	initSearchField();
}

window.onload = init;