
function NewXMLHttpObj() {
        NewXmlHttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP") ;
        if ( ! NewXmlHttp )
                NewXmlHttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");

        return NewXmlHttp;
}
var XmlHttp = NewXMLHttpObj();

function showHideDeleted ( name ){
	var els = document.getElementsByName( name );
	for(i=0;i< els.length;i++){
//		els[i].className=="revoked"?els[i].className="unrevoked":els[i].className="revoked";
		if ( els[i].style.display ==  "block")
			els[i].style.display="none";
		else
			els[i].style.display="block";
	}

}
function CreaRequest() {
        if (XmlHttp) {
                if ( XmlHttp.readyState >= 1 ){
//                      NewXmlHttp = window.XMLHttpRequest?new XMLHttpRequest():new ActiveXObject("Microsoft.XMLHTTP")
//                      if (window.XMLHttpRequest ){   var NewXmlHttp = new XMLHttpRequest(); }
  //                    else {                         var NewXmlHttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");  }
                        return NewXMLHttpObj() ;
                }
                if ( XmlHttp.readyState == 0 ) {
                        return XmlHttp;
                }

        } else {
//              if (window.XMLHttpRequest ){   var NewXmlHttp = new XMLHttpRequest(); }
//              else {                         var NewXmlHttp = new ActiveXObject("MSXML2.XMLHTTP.3.0");  }
//              return NewXmlHttp.createRequest();
                return  NewXMLHttpObj();
        }

}

function basename (path) { return path.replace( /.*\//, "" ); }
function addslashes(str) {
        str=str.replace(/\'/g,'\\\'');
        str=str.replace(/\"/g,'\\"');
        str=str.replace(/\\/g,'\\\\');
        str=str.replace(/\0/g,'\\0');
return str;
}
function stripslashes(str) {
        str=str.replace(/\\'/g,'\'');
        str=str.replace(/\\"/g,'"');
        str=str.replace(/\\\\/g,'\\');
        str=str.replace(/\\0/g,'\0');
return str;
}
function showHide ( div , time ) {
        if (time)
                var a = 1;
        else {
                var diva = document.getElementById( div );
                if ( ( diva.style.display == "block" ) || ( diva.style.display == "" ) ) {
               //         diva.style.opacity=1.0;
               //         opacity(div, 100, 0, 1000 );
                        diva.style.display = "none";
                } else {
                        if ( diva.style.display == "none" ) {
                //                diva.style.opacity=0.0;
                                diva.style.display = "block";
                //                opacity(div, 0, 100, 1000 );
                        }
                }
        }
}
function opacity(id, opacStart, opacEnd, millisec) {
    //speed for each frame
    var speed = Math.round(millisec / 100);
    var timer = 0;
    //determine the direction for the blending, if start and end are the same nothing happens
    if(opacStart > opacEnd) {
        for(i = opacStart; i >= opacEnd; i--) {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    } else if(opacStart < opacEnd) {
        for(i = opacStart; i <= opacEnd; i++)
            {
            setTimeout("changeOpac(" + i + ",'" + id + "')",(timer * speed));
            timer++;
        }
    }
}

function fetchPage( page , destin , Trefresh ) {
        var fXmlHttp =  CreaRequest();
        if (destin )
                var destinObj = document.getElementById( destin );
        fXmlHttp.open("get", page, true);
        fXmlHttp.onreadystatechange = function () {
/*               if (destinObj){
                        destinObj.innerHTML = "Fetching "+destin+"...<br><br><img align=center style='text-align:center;vertical-align:middle' src='images/w
aiting.gif' >";
                }*/
             if (fXmlHttp.readyState == 4) {
                    if (fXmlHttp.status == 200) {
                                if (destinObj){
                                        destinObj.innerHTML = fXmlHttp.responseText;
                                }
                                return fXmlHttp.responseText;
                        }
                    }


            };
            fXmlHttp.send(null);
}
function changeOpac(opacity, id) {
    var object = document.getElementById(id).style;
    object.opacity = (opacity / 100);
    object.MozOpacity = (opacity / 100);
    object.KhtmlOpacity = (opacity / 100);
    object.filter = "alpha(opacity=" + opacity + ")";
}
function opacizzando( div ){
        var diva = document.getElementById( div );

        if ( diva.style.display == "block" ) {
                if(diva.style.opacity==1.0){
                        return;}
                diva.style.opacity = ( diva.style.opacity + 0.1 );
        }
        if ( diva.style.display == "none" ) {
                if(diva.style.opacity==0.0){
                        return;}
                diva.style.opacity = ( diva.style.opacity - 0.1 );
        }
        setTimeout( 'opacizzando( "' + div + '" )' , 2 );

}

