


function EnableNewsRotator(){
	window.setInterval("ahah('newsrotator.php','newsrotator')",5000);
}


function SetCenterScreen(){
	maxW = screen.availWidth/2;
	maxH = screen.availHeight/2;

	if (document.layers){
	   browseWidth=top.window.outerWidth;
	   browseHeight=top.window.outerHeight;
	}
	if (document.all){
	   browseWidth=top.document.body.clientWidth;
	   browseHeight=top.document.body.clientHeight;
	}

	WW = (maxW-(browseWidth/2));
	HH = (maxH-(browseHeight/2));

	top.window.moveTo(WW,HH);
	top.window.focus();
}

function OpenWindow (page,w,h){
	maxW = screen.availWidth/2;
	maxH = screen.availHeight/2;

	WW = (maxW-(w/2));
	HH = (maxH-(h/2));

	window.open(page,"popup","width="+w+",height="+h+",top="+WW+",left="+HH);
}

function recselect(idbox){
	testo = document.FORM.boxselected.value;
	sear = "|"+idbox+"|";
	if (testo.search(sear) != -1) {
		document.FORM.boxselected.value = testo.replace(sear,"");
	}else{
		document.FORM.boxselected.value +=  sear;
	}
}

function recselectall() {

	var chckbxs=document.getElementById('tbmane').getElementsByTagName("input");
	for(var i=0;i<chckbxs.length;i++)
     {
          if(chckbxs[i].type=="checkbox")
          {
          	if (chckbxs[i].name.indexOf('boxselectall') !=-1)
            	 check = chckbxs[i].checked;
          }
    }

	document.FORM.boxselected.value = "";

	var chckbxs=document.getElementById('tbmane').getElementsByTagName("input");
	for(var i=0;i<chckbxs.length;i++)
	{
		  if(chckbxs[i].type=="checkbox")
		  {
			if (chckbxs[i].name.indexOf('boxselector') !=-1){
				chckbxs[i].checked = check;
				if ((check) && (chckbxs[i].value > -1)) document.FORM.boxselected.value += "|"+chckbxs[i].value+"|";
		  	}
		  }
	}

}

function AddSelectedAndJump(url,target){

		sel = document.FORM.boxselected.value;
		app = url.split("?");
		if (app[1]){
			url += "&ids="+sel;
		}else{
			url += "?ids="+sel;
		}

		if (target=="popup"){
			wpopup(url, 'popup', 'width=700,height=500,resizable=1');
		}else{
			document.location.href = url;
		}

}

function wpopup(page,name,opt){
	if (opt==""){opt="width=700,height=500,resizable=1";}
	window.open(page,name,opt);
}

function hideLoadMessage() {
	document.getElementById('loaderContainer').style.display = 'none';
}

function startsearch(){
	window.alert('qui');
	//document.location.href = '?idp=x&amp;words='+document.form.words.value ;
}

