function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  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 MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}



function getsupport ( selectedtype )
	{
		document.forms['groupForm'].submit() ;
	  //document.groupForm.orderBy.value = selectedtype ;
	  //document.groupForm.submit() ;
	}


function change_plattform(pid)
{
	if (pid == 8)
		document.getElementById("ukat_box").style.display = "none";
	else document.getElementById("ukat_box").style.display = "block";
}




function change_kat(kat)
	{

		//ukat = document.forms[0].ukat_id;
		//ids = new Array (1,2,3,4,5);
		//names = new Array ("name1","name2","name2","name2","name2");

		//alert("kat: " + kat);
		//if ()
		//alert(document.createGameForm.uk_id.options.lenght + " : " + kat + " und leght: " + ukats[kat]['uknames'].length  + " und kat: " + ukats[3]['uknames'].length);


		// alte einträge löschen
		/*
		for (j=0; j<document.createGameForm.uk_id.length; j++)
			document.createGameForm.uk_id.options[j] = null;




*/
		//alert("immer noch " + document.createGameForm.uk_id.options.length);

		for (j=0; j<20; j++)
		{
			//alert("delete " + document.createGameForm.uk_id.options[j].name);
			document.createGameForm.uk_id.options[j] = null;
		}
		for (j=0; j<20; j++)
		{
			//alert("delete " + document.createGameForm.uk_id.options[j].name);
			document.createGameForm.uk_id.options[j] = null;
		}
		for (j=0; j<20; j++)
		{
			//alert("delete " + document.createGameForm.uk_id.options[j].name);
			document.createGameForm.uk_id.options[j] = null;
		}

		/*
		for (var opt in document.createGameForm.uk_id.options)
			document.createGameForm.uk_id.options[opt] = null;
*/

		//if (kat == )

		//alert("immer noch " + document.createGameForm.uk_id.options.length);

		if (ukats[kat] != undefined)
		{
			for (i=0;i<ukats[kat]['uknames'].length;i++)
			{
				//alert(ukats[kat]['uknames'][i]);
				opt = new Option (ukats[kat]['uknames'][i],ukats[kat]['ukids'][i],false,false);
				document.createGameForm.uk_id.options[i] = opt;
			}
		}
	}

function showBox(box)
{
	//alert(box);
	document.getElementById(box).style.display = "block";
}

function switchVisibility(box, type)
{
	//alert(box);
	document.getElementById(box).style.visibility = type;
}


function openWindow(url, name)
{
	F1 = window.open(url, name, "height=800,width=1000,left=0,top=0,toolbar=No,location=No,scrollbars=Auto,status=No,resizable=No,fullscreen=No");
	F1.focus();
}

function openWindow2(url, name)
{
	F1 = window.open(url, name, "height=800,width=600,left=0,top=0,toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fullscreen=No");
	F1.focus();
}

/*
function openPage(url)
{
	F1 = window.open(url, "screenshots", "height=900,width=1000,left=0,top=0,toolbar=No,location=No,scrollbars=Yes,status=No,resizable=No,fullscreen=No");
	F1.focus();
}
*/


function checkGameModi(id){
	//alert("showBoxInline id: " + id);
	d = document;
	o1 = d.getElementById('231');
	o2 = d.getElementById('232');

	//alert(o1.selectedIndex + " : " + o2.selectedIndex);

	if ( (o1.selectedIndex != 9 && o1.selectedIndex != 0) || ( o2.selectedIndex != 9 && o2.selectedIndex != 0) )
		switchVisibility(id, "visible");
	else switchVisibility(id, "hidden");

}


function textCounter(field, id, maxlimit) {
	d = document;
	o = d.getElementById(id);
	//alert(o.innerHTML);

	if (field.value.length > maxlimit){
		field.value = field.value.substring(0, maxlimit);
	}
	else {
		//o.value = maxlimit - field.value.length;
		o.innerHTML = maxlimit - field.value.length;
	}
}

function setTestBewertungen(grafik, sound, gameplay, umfang, gesamteindruck, gesamt){
	//alert(grafik + " : " + sound + " : " + gameplay + " : " + umfang + " : " + gesamteindruck + " : " + gesamt);
	d = document;
	d.getElementById('grafik_score').value = grafik;
	d.getElementById('sound_score').value = sound;
	d.getElementById('gameplay_score').value = gameplay;
	d.getElementById('umfang_score').value = umfang;
	d.getElementById('gesamteindruck_score').value = gesamteindruck;
	d.getElementById('gesamt_score').value = gesamt;

}

