// expanding-contracting left-hand navigation
function showhide(what){     
	elmnt = document.getElementById(what);
	if (elmnt.style.display == 'none'){
		elmnt.style.display = 'block';
	}
	else{ 
		elmnt.style.display = 'none';
	}
}

// opens pop-up print window
function openPrintWindow(url,winName,features){
	if (url.indexOf(".shtml") > -1){
		window.open(url + "?style=print","newPrint",'scrollbars=yes,width=600,height=700,screenx=10,screeny=10,top=10,left=10')
		
	}
	else{
		window.open(url + "&style=print","newPrint",'scrollbars=yes,width=600,height=700,screenx=10,screeny=10,top=10,left=10')
	}
}


function getprintcss(){

loadcss = document.createElement('link');

loadcss.setAttribute("rel", "stylesheet");

loadcss.setAttribute("type", "text/css");

loadcss.setAttribute("href", "/styles/print.css");

document.getElementsByTagName("head")[0].appendChild(loadcss);

}
function getdefaultcss(){

loadcss = document.createElement('link');

loadcss.setAttribute("rel", "stylesheet");

loadcss.setAttribute("type", "text/css");

loadcss.setAttribute("href", "/styles/default.css");

document.getElementsByTagName("head")[0].appendChild(loadcss);

}

// bookmarks page in IE and FF
function addBookmark(title,url){
	if (window.sidebar){
		window.sidebar.addPanel(title, url,"");
	}
	else if( document.all ){
		window.external.AddFavorite( url, title);
	}
}

popupWins = new Array();
function windowOpener(url, name, args) {
	if ( typeof( popupWins[name] ) != "object" ) {
		popupWins[name] = window.open(url,name,args);
	} else {
		if (!popupWins[name].closed){
			popupWins[name].location.href = url;
		} else {
			popupWins[name] = window.open(url, name,args);
		}
	}
	popupWins[name].focus();
}

function gotoPage(u) { 
	if(top.opener!=null) { 
		top.opener.location.href = u; 
	}
}

//SEARCH

function searchString(languageCode, site, client, output, serverName) {
	var q = document.getElementById("searchValue").value;
	q = encodeURI(q);
	window.location.href = "http://"+serverName+"/"+languageCode+"/utils/search.shtml?q="+q+"&site="+site+"&client="+client+"&output="+output;
} 


function searchValue(value) {    if (value!='') {   value = decodeURI(value);      value=value.replace(/&amp;#39;/g, "'");      k=value.search(/&#39.+/);      if(k!=-1) {    value = decodeURI(value);       }      document.getElementById("searchValue").value=value;    }   else {       document.getElementById("searchValue").value="Search";    }  }    
function searchTxt(q) {   q = decodeURI(q);   q=q.replace(/&amp;/g, '&');    k=q.search(/&#39.+/);    if(k!=-1) {      q = encodeURI(q);     }     document.getElementById("searchTxtLayer").innerHTML = q;  }

