
function Xopen(file,window,tool,loc,dir,stat,menu,scroll,resiz,Wsize,Hsize,Xtop,Xleft) {
    var Xopen = open(file,'popup','fullscreen=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+',scrollbars='+scroll+',resizable='+resiz+',width='+Wsize+',height='+Hsize+',top='+Xtop+',left='+Xleft);
}

function Xopen1(file,window,tool,loc,dir,stat,menu,scroll,resiz,Wsize,Hsize,Xtop,Xleft) {
    var Xopen = open(file,'popup1','fullscreen=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+',scrollbars='+scroll+',resizable='+resiz+',width='+Wsize+',height='+Hsize+',top='+Xtop+',left='+Xleft);
}

function Xopen2(file,window,tool,loc,dir,stat,menu,scroll,resiz,Wsize,Hsize,Xtop,Xleft) {
    var Xopen = open(file,'popup2','fullscreen=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+',scrollbars='+scroll+',resizable='+resiz+',width='+Wsize+',height='+Hsize+',top='+Xtop+',left='+Xleft);
}

function XopenH(file,window,tool,loc,dir,stat,menu,scroll,resiz,Wsize,Hsize,Xtop,Xleft) {
    var XopenH = open(file,window,'fullscreen=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+',scrollbars='+scroll+',resizable='+resiz+',width='+Wsize+',height='+Hsize+',top='+Xtop+',left='+Xleft);
}

function XopenS(file,windname,tool,loc,dir,stat,menu,scroll,resiz,Wsize,Hsize,Xtop,Xleft) {
    top.XopenCOPR = window.open(file,windname,'fullscreen=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+',scrollbars='+scroll+',resizable='+resiz+',width='+Wsize+',height='+Hsize+',top='+Xtop+',left='+Xleft);
}

function XopenDWN(file,windname,tool,loc,dir,stat,menu,scroll,resiz,Wsize,Hsize,Xtop,Xleft) {
    XopenDW = window.open(file,windname,'fullscreen=no,toolbar='+tool+',location='+loc+',directories='+dir+',status='+stat+',menubar='+menu+',scrollbars='+scroll+',resizable='+resiz+',width='+Wsize+',height='+Hsize+',top='+Xtop+',left='+Xleft);
    XopenDW.document.execCommand('SaveAs','null',file);
}

function apriIMG(file) {
    var apriwin = open(file,'','resizable=yes,top=0,left=0');
}

function chiudi(tempo) {
	setTimeout('self.close()', tempo);
}

function etic(file,window) {
    var etic = open(file,window,'scrollbars=yes,resizable=yes,width=790,height=' + (screen.availHeight - 60) + ',top=0,left=0');
}

function stretch(Wsize,Hsize) {
	self.moveTo  (((screen.availWidth/2) - (Wsize/2)),((screen.availHeight/2) - (Hsize/2)))
	self.resizeTo( Wsize,Hsize )
}

function upd_sql(file) {
	parent.parent.rich_sx.rich_sx2.location.href = file;
}

function back_lst() {
	Xopen('rich_lst_rit.asp',"",0,0,0,0,0,0,1,290,130,((screen.availHeight/2)-80),((screen.availWidth/2)-150)); 
}

function trim(strText) { 
	while (strText.substring(0,1) == ' ') 
        strText = strText.substring(1, strText.length);
    while (strText.substring(strText.length-1,strText.length) == ' ')
        strText = strText.substring(0, strText.length-1);
   return strText;
}

function replace(string,text,by) {
    var strLength = string.length, txtLength = text.length;
    if ((strLength == 0) || (txtLength == 0)) return string;

    var i = string.indexOf(text);
    if ((!i) && (text != string.substring(0,txtLength))) return string;
    if (i == -1) return string;

    var newstr = string.substring(0,i) + by;

    if (i+txtLength < strLength) {
        newstr += replace(string.substring(i+txtLength,strLength),text,by);
	}
    return newstr;
}

function do_help(xWho,Xstato) {
	for (i = 0; i < eval(xWho  + ".document.all.length"); i++) {
		if (eval(xWho  + ".document.all['Lhelp" + i + "']")) {
			eval(xWho  + ".document.all['Lhelp" + i + "'].style.visibility = '"+  Xstato + "'");
		}
	}
}