var image_url;
var image_width;
var image_height;

function add_to_fav() {
        this.style.behavior='url(#default#homepage)';
        this.setHomePage('http://fredi.coddex.com/');
}

// ------------------------ General AJAX ------------------------ //
function createRequestObject() {
        var http = null;

        if (window.XMLHttpRequest) {
                http=new XMLHttpRequest();
        } else {
                http=new ActiveXObject("Microsoft.XMLhttp");
        }
        if (http==null) {
                alert("Your browser doesn't support AJAX.");
                return false;
        }
        return http;
}

var http = createRequestObject();
var http2 = createRequestObject();

// ---------------------- END General AJAX ---------------------- //

// -------------------------- LOADING --------------------------- //
function loadingHTML(txt, image) {
        var loadingHtml = '';
        if (image == "2") {
                LoadingImage = "images/loading_small_white.gif";
                LoadingImage_Width = "28";
                LoadingImage_Height = "28";
        } else {
                LoadingImage = "images/loading_big.gif";
                LoadingImage_Width = "100";
                LoadingImage_Height = "100";
        }
        loadingHtml += '<center><img src="'+ LoadingImage +'" alt="loading..." title="loading..." border="0" width="'+ LoadingImage_Width +'" height="'+ LoadingImage_Height +'"><br>'+txt+'</center>';

        return loadingHtml;
}
// ------------------------ END LOADING ------------------------- //

function random() {
        RandomNumber = Math.floor(Math.random()*1000000000);
        return RandomNumber;
}

function setOpacityByPercent(obj, opacity) {
        opacity = (opacity == 100)?99.999:opacity;

        // IE
        obj.style.filter = "alpha(opacity:"+opacity+")";

        // Safari<1.2, Konqueror
        obj.style.KHTMLOpacity = opacity/100;

        // Older Mozilla and Firefox
        obj.style.MozOpacity = opacity/100;

        // Safari 1.2, newer Firefox and Mozilla, CSS3
        obj.style.opacity = opacity/100;
}

function gallery_enlarge(url, width, height) {
        var usr_win = window.open('','ъоерд','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+width+',height='+height);

        usr_win.document.write("<html><body style='margin: 0px; padding: 0px;'>");
        usr_win.document.write("<table cellspacing='0' cellpadding='0' border='0' width='100%' height='100%'>");
        usr_win.document.write('<tr>');
        usr_win.document.write("<td valign='middle' align='center' width='100%' height='100%'><img src='"+url+"' width='"+width+"' height='"+height+"'></td>");
        usr_win.document.write('</tr>');
        usr_win.document.write('</table>');

}



