function image_ro(obj, opa){
	if (obj.style.MozOpacity) obj.style.MozOpacity=opa;
	else if (obj.filters) obj.filters.alpha.opacity=opa*100;
}
function swap(dr, obj) {
	arro[obj].style.top=15+dr*10+'px';
	scrl_1.ctrl(dr*-1);
}
function scrollV_move(scrl){
	var tp = parseInt(scrl.style.top.replace('px',''));
	if ((tp<=0)&&(tp>=-scrl.offsetHeight+scrl.outh)) {
		scrl.style.top = (tp+scrl.step)+'px';
		if ((scrl.step>0)&&(scrl.step<scrl.maxstep)) scrl.step+=0.3;
		else if ((scrl.step<0)&&(scrl.step>-scrl.maxstep)) scrl.step-=0.3;
	} else {
		scrl.on=false;
		clearInterval(scrl.intID);
		if (tp>0) scrl.style.top = '0px';
		else if(tp<-scrl.offsetHeight+scrl.outh) scrl.style.top = (-scrl.offsetHeight+scrl.outh)+'px';
	}	
}
function scrollV_ctrl(stp) {
	if (stp==0) {
		this.scrl.on=false;
		clearInterval(this.scrl.intID);
	} else if (!this.on) {
		var tp = parseInt(this.scrl.style.top.replace('px',''));
		if ((tp<=10)&&(tp>=-this.scrl.offsetHeight+this.scrl.outh-stp)) {
			if (!((tp>=0)&&(stp>0))) {
				this.scrl.step = stp;
				this.scrl.style.top = (tp+stp)+'px';
				this.scrl.intID = setInterval("scrollV_move(scrl_"+this.ID+".scrl)", 50);
				this.scrl.on = true;
			}
		}
	}
}
function scrollObj(ID, outh, tp, idpag) {
	this.ctrl = scrollV_ctrl;
	this.scrl = document.getElementById('ul_'+idpag);
	this.scrl.style.top = tp+'px';
	this.ID = ID;
	this.scrl.on = false;
	this.scrl.outh = outh;
	this.scrl.step = 1;
	this.scrl.maxstep = 10;
}
var xmlHttp = new Array();
function GetXmlHttpObject() {
	var xmlHttp=null;
	try {
		xmlHttp=new XMLHttpRequest();
	} catch (e) {
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
}
function get_ajax(tip, wh, objid, lg){
	xmlHttp[tip] = GetXmlHttpObject();
	if (xmlHttp[tip]==null) {
		alert ("Browser does not support HTTP Request");
		return;
	}
	var obj = document.getElementById(objid);
	obj.innerHTML = '<img src="images/loading.gif" width="32" height="32" alt="Attendere prego..." />';
	if (tip) obj.innerHTML += ' Caricamento...';
	var urll = "ajax.php?tip="+tip+"&wh="+wh+"&lg="+lg+"&sid=" + Math.random();
	if (get_ajax.arguments.length>4) urll += '&w=' + get_ajax.arguments[4];
	if ((tip>=0)&&(tip<=1)) xmlHttp[tip].onreadystatechange = function(){
		if ((xmlHttp[tip].readyState==4)||(xmlHttp[tip].readyState=="complete")) {
			if ((tip==1)||((tip==0)&&(obj.innerHTML.substr(0, 4)=='<img'))) obj.innerHTML = xmlHttp[tip].responseText;
		}
	}
	xmlHttp[tip].open("GET", urll, true);
	xmlHttp[tip].send(null);
}
function chk_href(obj) {
	return true;
}
var old_tn;
function show_tn(pg, lg){
	if (!old_tn) old_tn = document.getElementById('tn').innerHTML; 
	if (pg==0) document.getElementById('tn').innerHTML = old_tn;
	else get_ajax(0, pg, 'tn', lg);
}
