// JavaScript Document
var curarea
var curpos
function loadList(pos,id)
{
	curarea=id;
	curpostmp= window.location.search.substring(1).split("&pos=")
	curpos=curpostmp[1]
	document.getElementById("pos_"+curarea).style.display = "inline";

	found=false
	for(i=0;document.getElementById("pos_"+curarea).length>i;i++){
		if(found!= true)
		tmp=document.getElementById("pos_"+curarea).options[i].value.split("_");
		if(tmp[1]==curpos&&found==false){
			found=true
			document.getElementById("pos_"+curarea).selectedIndex = i
			document.getElementById("pos_list"+curarea+"_"+tmp[1]).style.display = "inline";
			document.getElementById("pos_list"+curarea+"_"+tmp[1]).style.display = "inline";
		}
	}
 	if(found== false){
		curpos=0
		if(curarea!=37)	getAllPos("inline")
		document.getElementById("pos_"+curarea).selectedIndex = 0
	}
	for(i=0;window.document.posForm.area.value!=curarea;i++){
		document.getElementById("area").selectedIndex  = i;
	}
}

function displayArea(){
	window.location.href="index.php?id="+window.document.posForm.area.value;
}
function dispalyPosition(){
	tmp=window.document.posForm["pos_"+curarea].value.split("_")
	newvalue=tmp[1];
	if(curpos==0){
		getAllPos("none")
	}else{
		document.getElementById("pos_list"+curarea+"_"+curpos).style.display = "none";
	}
	if(newvalue==0){
		getAllPos("inline")
	}else{
		document.getElementById("pos_list"+curarea+"_"+newvalue).style.display = "inline";
	}
	curpos=newvalue;
}
function displayAreaPosition(){
	newvalue=window.document.posForm["pos_"+curarea].value.split("_")
	window.location.href="index.php?id="+newvalue[0]+"&pos="+newvalue[1];
}
function getAllPos(display){
		for(var i=1;document.getElementById("pos_"+curarea).length>i;i++){
			jtmp=document.getElementById("pos_"+curarea).options[i].value
			tmp=jtmp.split("_")
			j=tmp[1];
			document.getElementById("pos_list"+curarea+"_"+j).style.display = display;
		}
		if(display=="inline")
		document.getElementById("pos_"+curarea).selectedIndex=0
}
// -->

