// JavaScript Document
function selectchange(first, middle)
{
	if (middle!="") {
		var l=middle.options[middle.selectedIndex].value;
		window.location.href=first + l;
	}
}

function changeOptions(id,num){
	var tag = document.getElementById(id);
	var len = num.substr(num.lastIndexOf(" "));

	//clear options
	tag.options.length = 0;
	
	//insert new num options
	for (i = 0; i < len; i++){
		tag.options[i]=new Option(i+1, i+1);
	}
}

/**
  * submit form with confirm
  */
function submitForm(actionURL, formName, conf){
	if (conf != undefined){
		if (confirm(conf)){
			document.getElementById(formName).action=actionURL;
			document.getElementById(formName).submit();
		}
	} else {
		document.getElementById(formName).action=actionURL;
		document.getElementById(formName).submit();
	}
}

/** show img in tag */
function imgShow(id){
	$a = document.getElementById(id).getElementsByTagName('img');
	$a[0].style.display='block';
}

/** hide img in tag */
function imgHide(id){
	$a = document.getElementById(id).getElementsByTagName('img');
	$a[0].style.display='none';
}

/** show div */
function showId(id){
	document.getElementById(id).style.display='block';
}

function hideId(id){
	document.getElementById(id).style.display='none';
}
