
var t;
var idg;
var loadidg;
var bodyoutpg;
function updatepage(){
   if(ajaxreq.readyState == 4){  
     document.getElementById("body").innerHTML =  ajaxreq.responseText;
	 document.getElementById(loadidg).innerHTML =  "<img src=images/loaded.gif>";
	}
}
function updatepage_opt(){
   if(ajaxreq.readyState == 4){  
     document.getElementById(bodyoutpg).innerHTML =  ajaxreq.responseText;
	 document.getElementById(loadidg).innerHTML =  "<img src=images/loaded.gif>";
	}
}



function isNumeric(value) {
  if (value == null || !value.toString().match(/^[-]?\d*\.?\d*$/)) return false;
  return true;
}

function SelectAll(id)
{
    document.getElementById(id).focus();
    document.getElementById(id).select();
}


function reqpage(page,loadid){
		loadidg=loadid;
		   document.getElementById(loadid).innerHTML =  "<img src=images/loading.gif>";
			filename = page;
			
			ajaxCallback=updatepage;
			ajaxRequest(filename);

}

function reqpage_opt(page,loadid,bodyoutp){
		loadidg=loadid;
		bodyoutpg=bodyoutp;
		   document.getElementById(loadid).innerHTML =  "<img src=images/loading.gif>";
			filename = page;
			
			ajaxCallback=updatepage_opt;
			ajaxRequest(filename);

}


function setVisibility(id, visibility) {
document.getElementById(id).style.display = visibility;
}


function popupslip(url){
	var newwindow;
			newwindow = window.open(url,"mywindow","height=500,width=200,status=no,toolbar=no,menubar=no");

}
function popup(url){
	var newwindow;
			newwindow = window.open(url,"mywindow","height=500,width=900,status=no,toolbar=no,menubar=no,scrollbars=yes");
}

function showpicture(code){
	var newwindow;
			newwindow = window.open("showpic.php","mywindow","height=500,width=600,status=no,toolbar=no,menubar=no");

			newwindow.document.writeln("<center><img src=../../picturelib/items/" + code + "></center>");
}


   function hidesubmenu(id){
	   document.getElementById(id).innerHTML= "";
			
   }

function redirectactionpage(page,url){
			 location.reload("?page=" + page + url);
}


