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 clearSearch(event, field)
{
	var stdTxt = '';
	if(field == 'searchField')
	{
		stdTxt = 'Suchbegriff';
	}
	else if(field == 'username')
	{
		stdTxt = 'Nachname';
	}
	else if(field == 'password')
	{
		stdTxt = 'Mitgliedsnummer';
	}
		
	var feld = document.getElementById(field).value;

	if(event=='focus')
	{
		if(feld == stdTxt)
		{
			document.getElementById(field).value = '';
		}
	}
	else if(event == 'blur')
	{
		if(feld == '')
		{
			document.getElementById(field).value = stdTxt;
		}	
	}

}

function enterKlinik(Ereignis)
{
	if(!Ereignis)
	{
    	Ereignis = window.event;
	}

    if(Ereignis.keyCode==13)
    {
		findKlinik($F('kliniksuche'));
        return false;
	}
}

function findKlinik(search)
{
	var ax = new Ajax.Updater('modKlinikverzeichnis',
		'page.php',{
			method: 'get',
			parameters: 'pageid='+$F('KlinikPageid')+'&pcode='+$F('KlinikPcode')+'&module=klinikverzeichnis&kliniksuche='+search+'',
			evalScripts:true
		});

	return false;
}

function enterLogin(Ereignis)
{
	if(!Ereignis)
	{
    	Ereignis = window.event;
	}

    if(Ereignis.keyCode==13)
    {
		document.frmLogin.submit();
        return false;
	}
}