
function go2url(url) {
	document.forms[0].target="_self";
	document.forms[0].action=url;
	document.forms[0].submit();
}

function openMenu(url,menuChoice) {
	document.forms[0].target="_self";
	document.forms[0].selectedNavMenu.value=menuChoice;
	document.forms[0].action=url;
	document.forms[0].submit();
}

function go2urlPost(url, args){

	document.write('<form name="list" method="post" action="'+url+'">');
	if (args!="") {
		var arr1 = args.split("&");

		for (i=0; i<arr1.length; i++)
		{
			pair=arr1[i].split("=");
			document.write('<input type="hidden" name="'+pair[0]+'" value="'+pair[1]+'" >');
		}
	}
	document.write('</form>');
	document.write('<SCRIPT language=javascript>');
	document.write('document.forms[0].submit();');
	document.write('</SCRIPT>');
}

function optionsOverview(id,select_name) {
	document.forms[0].target="_self";
	document.forms[0].select_id.value=id;
	document.forms[0].select_name.value=select_name;
	document.forms[0].action="./optionOverview.php";
	document.forms[0].submit();
}

function back2rubrik() {
	document.forms[0].target="_self";
	document.forms[0].edit_id.value=document.forms[0].rid.value;
	document.forms[0].action="./rubrik.php";
	document.forms[0].submit();
}

function pop2url(url) {
	document.forms[0].target="_blank";
	document.forms[0].action=url;
	document.forms[0].submit();
}

function changeStatus(iid, newStatus) {
	document.forms[0].target="_self";
	document.forms[0].newStatus.value=newStatus;
	document.forms[0].changeStatusTo.value=iid;
	document.forms[0].submit();
}

function checkEnter4Search(e){
	var characterCode;
	if (!e) var e = window.event;
	if (e.keyCode) characterCode = e.keyCode;
	else if (e.which) characterCode = e.which;
	//alert(characterCode+' '+prev_character);
	if(characterCode == 13 && prev_character!=40 && prev_character!=38) {
		leeren();
		return false;
	} else {
		prev_character = characterCode;
		return true;
	}
}

function paging()
{
	document.forms[0].noPaging.value='';
	view(0);
}
function no_Paging()
{
	document.forms[0].noPaging.value=1;
	view(0);
}
function expandBox(boxid, endsize, speed) {
	var startsize = document.getElementById(boxid).style.height;
	var startpixel = parseInt(startsize.substring(0,startsize.length-2));
	var endpixel = endsize;

	var increment_pixel = startpixel;
	while(increment_pixel <= endpixel) {
		document.getElementById(boxid).style.height = increment_pixel+'px';
		increment_pixel++;
	}
}
function shrinkBox(boxid, endsize, speed) {
	var startsize = document.getElementById(boxid).style.height;
	var startpixel = parseInt(startsize.substring(0,startsize.length-2));
	var endpixel = endsize;

	var increment_pixel = startpixel;
	while(increment_pixel >= endpixel) {
		document.getElementById(boxid).style.height = increment_pixel+'px';
		increment_pixel--;
	}
}

function addDateMod(ob){
	var ids = 'search'+ob.id.substr(3);
	var val=document.getElementById(ids).value;
	var init=val.substring(0,1);
	var newval;
	if(init=='=' || init=='>' || init=='<') {newval=val.substr(1);}
	else if(init=='&') {newval=val.substr(4);}
	else {newval=val;}
	document.getElementById(ids).value=ob[ob.selectedIndex].value+newval;
}

function checkSuggestEmpty(fld) {
	if ( $('_' + fld).value == '') {
		$(fld).value = '';
	}
}
