function gotoPage(pagetogo){
	window.location=pagetogo;
}

function gotoPageConfirm(pagetogo,confstr){
	var name=confirm(confstr);
	if(name==true){
		window.location=pagetogo;
	}
}



function chngPass(pass_fld,chkd){
		if(chkd.checked)
			pass_fld.disabled=false;
		else
			pass_fld.disabled=true;
}

function formSubmit_act_id_opener(hi,val,fldname,openersrc,id,idx){
			hi.act.value=val;
			hi[fldname].value=idx;
			hi.fldname.value=fldname;
			hi.openersrc.value=openersrc;
			hi.id.value=id;
			hi.id2.value=idx;
			hi.submit();
}

function openWin(src) {
  window.open(src,"","scrollbars=yes, width=700,height=475");
}

function voidkey(){
	return false;
}

function openWin2(src,t,l,w,h) {
var t_1=0;
var l_1=0;
if(t!=0 && t!="") t_1=t;
if(l!=0 && l!="") l_1=l;
  window.open(src,"","top="+t_1+",left="+l_1+",status=yes,scrollbars=yes,width="+w+",height="+h+"");
}

function openWin3(src,left,top,w,h,tool_bar) {
  window.open(src,"","scrollbars=yes, toolbar="+tool_bar+", left="+left+", top="+top+",width="+w+",height="+h+"");
}

function openWin2chekfld(src,hiform,elementnm,w,h) {
	var str=''+elementnm+''
	var temp=hiform[str];
	if(temp.checked){
	  window.open(src,"","scrollbars=yes,width="+w+",height="+h+"");
	 }
}

function openWinPopupSelect(idx,src,hiform,elementnm,elementnm2,w,h) {
	if(hiform!=''){
		if(elementnm2!=''){
			var temp2=hiform[elementnm2];
			temp2.options[idx].selected=true;
		}
		if(elementnm!=''){
			var temp=hiform[elementnm];
			if(temp.options[idx].value==-1){
			  window.open(src,"","scrollbars=yes,width="+w+",height="+h+"");
			 }
		}
	}else if(idx==''){
		window.open(src,"","scrollbars=yes,width="+w+",height="+h+"");
	}
}

function beforePopupSelect(idx,src,hiform,elementnm,elementnm2,actstr,id) {
	var temp=hiform[elementnm];
	var temp2=hiform[elementnm2];
	if(elementnm2!=''){
		temp2.options[idx].selected=true;
	}

	hiform.id.value=id;

	if(temp.options[idx].value == "-1"){
		hiform.opensrc.value=src;
		hiform.act.value=actstr;
		hiform.popupact.value='beforepopup';
		hiform.submit();
	}
}

function beforePopupSelect2(idx,src,hiform,elementnm,elementnm2,actstr,id) {
	var temp=hiform[elementnm];
	var temp2=hiform[elementnm2];
	if(elementnm2!=''){
		temp2.options[idx].selected=true;
	}

	hiform.id.value=id;

	if(temp.options[idx].value == "-1"){
	hiform.opensrc.value=src;
	hiform.act2.value=actstr;
	hiform.popupact.value='beforepopup';
		hiform.submit();
	}
}

function open_Win(src)
{
	window.open(src,"_blank","toolbar=yes, location=yes, directories=no, status=no, menubar=yes, scrollbars=yes, resizable=no, copyhistory=yes, width=400, height=400")
}


function passenable(){
	if(document.addEditForm.pass.disabled==true)
		document.addEditForm.pass.disabled=false;
	else
		document.addEditForm.pass.disabled=true;
}

function changeOptVal(x,hiform,elementnm){
	var str=''+elementnm+''
	var temp=hiform[str];
	temp.options[x].selected=true
}

function changeOptVal2(x,hiform,elementnm){
	var str=document.getElementById(elementnm);
	var temp=str;
	temp.options[x].selected=true
}

//test numerics
function testIntNumeric (form,fld) {
	TestVar = isIntNumberString (form[fld].value)
	if (TestVar == 1)
		;
	else
		alert ("Error: type only numbers!");
}

function isIntNumberString (InString)  {
	if(InString.length==0) return (false);
	var RefString="1234567890";
	for (Count=0; Count < InString.length; Count++)  {
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1)
			return (false);
	}
	return (true);
}


function testDoubleNumeric (form,fld) {
	TestVar = isDoubleNumberString (form[fld].value)
	if (TestVar == 1)
		;
	else
		alert ("Error: type only float numbers!");
}

function isDoubleNumberString (InString)  {
	if(InString.length==0) return (false);
	var RefString="1234567890.";
	for (Count=0; Count < InString.length; Count++)  {
		TempChar= InString.substring (Count, Count+1);
		if (RefString.indexOf (TempChar, 0)==-1)
			return (false);
	}
	return (true);
}

function hideVisibleByCheck(check_idname,element_idname){
	check_id=document.getElementById(check_idname);
	element_id=document.getElementById(element_idname);

	if(check_id.checked){
		element_id.style.visibility="visible";
		element_id.style.position="relative";
	}else{
		element_id.style.visibility="hidden";
		element_id.style.position="absolute";
	}
}

function gotoPageConfirm(pagetogo,confstr){
	var name=confirm(confstr);
	if(name==true){
		window.location=pagetogo;
	}
}

function formSubmit_ById(fid){
	var formid=document.getElementById(fid);
	formid.submit();
}
//end test numerics
