function checkSelection(gender)
{
	if(gender=="m") //is male
	{
		if(document.dogfrm.fatherselection.value=="x")
		{
			//own name!
			var check;
			while(!check)
				check = prompt("Geben Sie den Namen bitte ein", "");
			//alert("here");
			document.dogfrm.fatherselection.options["ownmname"].text=check;
			document.dogfrm.ownfathername.value=check;	
		}
	}
	else if(gender=="f") //is female
	{
		if(document.dogfrm.motherselection.value=="x")
		{
			//own name!
			var check;
			while(!check)
				check = prompt("Geben Sie den Namen bitte ein", "");
			document.dogfrm.motherselection.options["ownfname"].text=check;
			document.dogfrm.ownmothername.value=check;
		}
	}
}
function checkTitleSelection(id)
{
	alert(document.edtPic.titletype[id]);
	/*if(document.forms[0].titletype[id].value==1) //dog
	{
		document.forms[0].littertitlesel[id].style.visibility="hidden";
		document.forms[0].dogtitlesel[id].style.visibility="visible";
	}
	else if(document.forms[0].titletype[id].value==2) //litter
	{
		document.forms[0].dogtitlesel[id].style.visibility="hidden";
		document.forms[0].littertitlesel[id].style.visibility="visible";
	}*/
}
function checkPictureSelection(sel, id, otype, oid)
{
		if(sel=="1")
			window.open("popup/editPicInfos.php?id="+id, "edtpicwindow", "width=350,height=180,hotkeys=no,menubar=no,locationbar=no,resizeable=no,status=no");
		if(sel=="2")
			window.open("popup/changePicType.php?id="+id, "edtpicwindow", "width=350,height=110,hotkeys=no,menubar=no,locationbar=no,resizeable=no,status=no");
		if(sel=="3")
			window.open("popup/changePicAcquisition.php?id="+id, "edtpicwindow", "width=350,height=140,hotkeys=no,menubar=no,locationbar=no,resizeable=no,status=no");
		if(sel=="4")
			window.open("popup/setTitlePic.php?id="+id+"&objtype="+otype+"&objid="+oid, "edtpicwindow", "width=230,height=130,hotkeys=no,menubar=no,locationbar=no,resizeable=no,status=no");
		if(sel=="5")
			location.href="intern.php?id=4&method=4&picid="+id;
}
function submitPictureForms(cnt)
{
	while(cnt--)
		document.forms[cnt].submit();

}

function navHover(elem,id, mode)
{
	if(mode==1)
		document.getElementById(elem).style.backgroundImage="url(images/navigation"+id+"_h.jpg)";
	else
		document.getElementById(elem).style.backgroundImage="url(images/navigation"+id+".jpg)";
}

function preloadImages()
{
    document.Preload = new Array();

    if(document.images)
    {
        for(var i = 0; i < preloadImages.arguments.length; i++)
        {
            document.Preload[i] = new Image();
            document.Preload[i].src = preloadImages.arguments[i];
        }
    }
}
