function changeBackground(backgroundImage){
	if (typeof(window.document.RO1.changeImage) == "function") {
		window.document.RO1.changeImage(backgroundImage);
	}
}	

function showLocation(location){
	$("location"+location).show();
}	

function hideLocations() {
	$$("div.location").each( function(item) {
		item.hide();
	});
}

function formFocus(field,active,word) {
	if (active && field.value == word) field.value='';
	else {
		if (field.value == "") field.value=word;
	}
	
}

function newCaptcha() {
	var myTime = new Date();
	$("captcha-img").src = "fileadmin/inc/class.captcha.php?" + myTime.getMilliseconds();
}

function addBookmark(title,url) {
     if (window.sidebar) { // firefox
     window.sidebar.addPanel(title, url, "");
     } else if (document.all) { // IE
     window.external.AddFavorite(url, title);
     } else if (window.opera && window.print) { // opera
     var elem = document.createElement("a");
     elem.setAttribute("href",url);
     elem.setAttribute("title",title);
     elem.setAttribute("rel","sidebar");
     elem.click();
     }
}

function getWindowHeight()
{
	var height;
	height = $("outer-container").getHeight()-233;
	
	var badIE = (navigator.userAgent.toLowerCase().indexOf('msie 6') != -1) || (navigator.userAgent.toLowerCase().indexOf('msie 7') != -1);
	if (badIE) {
		//height=height+81;
	}
 return height;
 
}

function getWindowWidth()
{
 if (self.innerWidth) return self.innerWidth;
 else if (document.body && document.body.clientWidth) return document.body.clientWidth;
 else return 0;
}

var remember_select = '';

function select_fold(obj){
	remember_select = obj;
	var obj_parent = document.getElementById(obj+'_parent');
	var obj = document.getElementById(obj+'_foldout');
	if(obj.style.display == 'none'){
		obj.style.display = '';
		obj_parent.style.zIndex = 999999;
		$('clear_select').setStyle ({ display: 'block' });
	}else{
		obj.style.display = 'none';
		obj_parent.style.zIndex = 1;
		$('clear_select').setStyle ({ display: 'none' });
	}
}

function select_setval(obj,val,txt){
	var linktext = document.getElementById(obj+'_link');
	linktext.innerHTML = txt;
	
	var feld = MM_findObj(obj);
	feld.value = val;
	select_fold(obj);
}

function MM_findObj(n, d) {
	var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  	if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  	if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function clear_select(){
	select_fold(remember_select);
}