var images = new Array();

function imagePreload()
{
    for(var i = 0; i < imagePreload.arguments.length; i++)
    {
        images[i] = new Image();
        images[i].src = imagePreload.arguments[i];
    } 
}

function changeImage(id,src)
{
	document.getElementById(id).src = '/dbgfx/menus/'+src;
}

function popUpWindow(url, width, height)
{
	var par = 'dependent=yes, toolbar=no,location=no,directories=no,status=no,copyhistory=no,scrollbars=yes,resizable=no,width=' + (width) + ',height=' + (height) + ',screenX=10,screenY=10';
	var rand = Math.floor(Math.random()*100000);
	
	win1 = window.open(url, "popupWindow_"+ rand, par);
	win1.resizeTo(width,height);
	win1.focus();
}

function videoWindow(url, width, height)
{
	width += 30;
	height += 40;
	
	var par = 'dependent=yes, toolbar=no,location=no,directories=no,status=no,copyhistory=no,scrollbars=yes,resizable=no,width=' + (width) + ',height=' + (height) + ',screenX=10,screenY=10';

	win1 = window.open(url, "videoWindow", par);
	win1.resizeTo(width,height);
	win1.focus();
}

function empfehlenWindow(id)
{
	var width = 310;
	var height = 400;
	var par = 'dependent=yes, toolbar=no,location=no,directories=no,status=no,copyhistory=no,scrollbars=no,resizable=no,width=' + (width) + ',height=' + (height) + ',screenX=10,screenY=10';

	win1 = window.open('weiterempfehlen.php?id='+id, "empfehlenWindow", par);
	win1.resizeTo(width, height);
	win1.focus();
}

function printWindow(url, width, height)
{
    var par = 'dependent=yes, menubar=yes, toolbar=yes,location=no,directories=no,status=yes,copyhistory=no,scrollbars=yes,resizable=yes,width=' + (width) + ',height=' + (height) + ',screenX=10,screenY=10';
    var rand = Math.floor(Math.random()*100000);
    
    win1 = window.open(url, "printWindow_"+ rand, par);
    win1.resizeTo(width,height);
    win1.focus();
}

function clearSearch(event)
{
	var feld = document.getElementById('searchField').value;

	if(event=='focus')
	{
		if(feld == 'Suchbegriff')
		{
			document.getElementById('searchField').value = '';
		}
	}
	else if(event == 'blur')
	{
		if(feld == '')
		{
			document.getElementById('searchField').value = 'Suchbegriff';
		}	
	}

}
function clearSearchDoc(event)
{
	var feld = document.getElementById('searchFieldDoc').value;

	if(event=='focus')
	{
		if(feld == ' bitte Postleitzahl, Ort, oder Name eingeben')
		{
			document.getElementById('searchFieldDoc').value = '';
		}
	}
	else if(event == 'blur')
	{
		if(feld == '')
		{
			document.getElementById('searchFieldDoc').value = ' bitte Postleitzahl, Ort, oder Name eingeben';
		}	
	}

}
function clearSearchKli(event)
{
	var feld = document.getElementById('searchFieldKli').value;

	if(event=='focus')
	{
		if(feld == ' bitte Postleitzahl, Ort, oder Name eingeben')
		{
			document.getElementById('searchFieldKli').value = '';
		}
	}
	else if(event == 'blur')
	{
		if(feld == '')
		{
			document.getElementById('searchFieldKli').value = ' bitte Postleitzahl, Ort, oder Name eingeben';
		}	
	}

}

function GP_popupConfirmMsg(msg) { 
  document.MM_returnValue = confirm(msg);
}

/*sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}*/
//if (window.attachEvent) window.attachEvent("onload", sfHover);