img_preload_pra= new Image();
img_preload_pra.src="http://img1.wprost.pl/G/ajax-loader.gif";

img_preload_pra1= new Image();
img_preload_pra1.src="http://img1.wprost.pl/G/layout/box_background_4.jpg";

var imgNastepnyZawartosc = '<img src="/G/icons/lbox_arrow_right.gif" alt="Następny" title="Następny" />';
var imgPoprzedniZawartosc = '<img src="/G/icons/lbox_arrow_left.gif" alt="Poprzedni" title="Poprzedni" />';
var imgBoxNextWP = null;
var imgBoxPrevWP = null;

function ColorTextChange(box,end_color) {
    mint.fx.Color(box, "color", null, end_color, 20, 500);
}

if (navigator.userAgent.indexOf("Opera") != -1
 && document.getElementById) type = "OP";
if (document.all) type = "IE";
if (document.layers) type = "NN";
if (!document.all && document.getElementById) type = "MO";
function unhide_block(id) {
    if (type == "IE") {
        eval("document.all." + id + ".style.visibility='visible'");
        eval("document.all." + id + ".style.position = 'static'");

    }
    if (type == "NN") {
        eval("document." + id + ".visibility='visible'");
        eval("document." + id + ".position = 'static'");

    }
    if (type == "MO" || type == "OP") {
        document.getElementById(id).style.visibility = 'visible';
        document.getElementById(id).style.position = 'static';

    }

}
function hide_block(id) {
    if (type == "IE") {
        eval("document.all." + id + ".style.visibility='hidden'");
        eval("document.all." + id + ".style.position = 'absolute'");

    }
    if (type == "NN") {
        eval("document." + id + ".visibility='hidden'");
        eval("document." + id + ".position = 'absolute'");

    }
    if (type == "MO" || type == "OP") {
        document.getElementById(id).style.visibility = 'hidden';
        document.getElementById(id).style.position = 'absolute';

    }

}
function print_article(nr) {
    if (nr == '1') {
        elementId = 'content-main-column-element-content';

    }
    if (nr == '2') {
        elementId = 'content-main-column';

    }
    if (nr == '3') {
        elementId = 'print-layer';

    }
    var printContent = document.getElementById(elementId);
    var windowUrl = 'about:blank';
    var uniqueName = new Date();
    var windowName = 'Print' + uniqueName.getTime();
    var printWindow = window.open(windowUrl, windowName, 'left=50000,top=50000,width=0,height=0');
    printWindow.document.write(printContent.innerHTML);
    printWindow.document.close();
    printWindow.focus();
    printWindow.print();
    printWindow.close();

}
var min = 10;
var max = 18;
var plusminusfontindiv = 'content-main-column-left';

function increaseFontSize(lay_optional) {
    if (lay_optional)
    plusminusfontindiv = lay_optional;
    var p = document.getElementById(plusminusfontindiv).getElementsByTagName('td');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));

        }
        else {
            var s = 12;

        }
        if (s < max) {
            s += 4;

        }
        p[i].style.fontSize = s + "px"

    }
    var p = document.getElementById(plusminusfontindiv).getElementsByTagName('div');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));

        }
        else {
            var s = 12;

        }
        if (s < max) {
            s += 4;

        }
        p[i].style.fontSize = s + "px"


    }
    var s = parseInt(document.getElementById(plusminusfontindiv).style.fontSize.replace("px", ""));
    if (s < max) {
        s += 4;

    }
    else {
        var s = 12;

    }
    document.getElementById(plusminusfontindiv).style.fontSize = s + "px"


}

function decreaseFontSize(lay_optional) {
    if (lay_optional)
    plusminusfontindiv = lay_optional;
    var p = document.getElementById(plusminusfontindiv).getElementsByTagName('td');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));

        }
        else {
            var s = 12;

        }
        if (s > min) {
            s -= 4;

        }
        p[i].style.fontSize = s + "px"

    }
    var p = document.getElementById(plusminusfontindiv).getElementsByTagName('div');
    for (i = 0; i < p.length; i++) {
        if (p[i].style.fontSize) {
            var s = parseInt(p[i].style.fontSize.replace("px", ""));

        }
        else {
            var s = 12;

        }
        if (s > min) {
            s -= 4;

        }
        p[i].style.fontSize = s + "px"

    }
    var s = parseInt(document.getElementById(plusminusfontindiv).style.fontSize.replace("px", ""));
    if (s < max) {
        s -= 4;

    }
    else {
        var s = 12;

    }
    document.getElementById(plusminusfontindiv).style.fontSize = s + "px"

}
function Add2Fav() {
    var t = document.title;
    var l = document.location;
    if (document.all)
    window.external.AddFavorite(l, t);
    else
    window.sidebar.addPanel(t, l, "");

}
function changeButton(title, img, url, target) {
    var serwis_img = document.getElementById("serwis_img");
    if (! (!serwis_img)) {
        serwis_img.src = "http://www.wprost.pl/G/buttons/" + img;
        serwis_img.alt = title;
        serwis_img.title = title;

    }
    var serwis_link = document.getElementById("serwis_link");
    if (! (!serwis_link)) {
        serwis_link.href = url;
        if (!target)
        serwis_link.target = "_blank";
        else
        serwis_link.target = target;

    }

}
var dynNews = new Array(0);
function DisplayNews(idd, idn) {
    obj = document.getElementById("A_" + idd);
    obj.innerHTML = dynNews[idd][idn][0];
    obj = document.getElementById("L_" + idd);
    obj.innerHTML = dynNews[idd][idn][1];
    obj = document.getElementById("D_" + idd);
    if (dynNews[idd][idn][2] == '')
    obj.style.display = 'none';
    else {
        obj.style.display = 'block';
        obj = document.getElementById("I_" + idd);
        obj.src = dynNews[idd][idn][3];

    }

}
function expMainBlock(sender, id, opposite) {
    obj = document.getElementById(id);
    if (typeof obj == 'object') {
        if (obj.style.display == 'none') {
            obj.style.display = 'block';
            sender.className = 'up-button';
            sender.title = 'Zwiń'
            if (opposite)
            v = 0;
            else
            v = 1;
            document.cookie = id + "=" + escape(v) + "; expires=Fri, 31 Dec 2020 23:59:59 GMT;";

        }
        else {
            obj.style.display = 'none';
            sender.className = 'down-button';
            sender.title = 'Rozwiń'
            if (opposite)
            v = 1;
            else
            v = 0;
            document.cookie = id + "=" + escape(v) + "; expires=Fri, 31 Dec 2020 23:59:59 GMT;";

        }

    }
    return false;

}
function expBlogBlock(sender) {
    obj = document.getElementById("blogAutor");
    if (typeof obj == 'object') {
        if (obj.style.display == 'none') {
            obj.style.display = 'block';
            sender.title = 'Ukryj informacje o autorze';
            sender.innerHTML = 'ukryj: o autorze'
            document.cookie = "blogAutor=" + escape('0') + "; expires=Fri, 31 Dec 2020 23:59:59 GMT;";

        }
        else {
            obj.style.display = 'none';
            sender.title = 'Pokaż informacje o autorze';
            sender.innerHTML = 'pokaż: o autorze';
            document.cookie = "blogAutor=" + escape('1') + "; expires=Fri, 31 Dec 2020 23:59:59 GMT;";

        }

    }
    return false;

}
function shMoreBar(sender, id) {
    obj = document.getElementById("arrOptions" + id);
    if (typeof obj == 'object') {
        if (obj.style.display == 'none') {
            obj.style.display = 'block';
            sender.src = '/G/icons/cont_ico_top.gif';
            sender.title = 'Zwiń opcje przeglądania'
            document.cookie = "arrOptions" + id + "=" + escape('1') + "; expires=Fri, 31 Dec 2020 23:59:59 GMT;";

        }
        else {
            obj.style.display = 'none';
            sender.src = '/G/icons/cont_ico_down.gif';
            sender.title = 'Rozwiń opcje przeglądania'
            document.cookie = "arrOptions" + id + "=" + escape('0') + "; expires=Fri, 31 Dec 2020 23:59:59 GMT;";

        }

    }

}
function shMoreBtnChPic(sender, objID, ev) {
    obj = document.getElementById(objID);
    if (typeof obj == 'object') {
        if (obj.style.display == 'none') {
            if (ev == 'over')
            sender.src = '/G/icons/cont_ico_down_.gif';
            else
            sender.src = '/G/icons/cont_ico_down.gif';

        }
        else {
            if (ev == 'over')
            sender.src = '/G/icons/cont_ico_top_.gif';
            else
            sender.src = '/G/icons/cont_ico_top.gif';

        }

    }

}
function showBanner(url) {
    document.writeln('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" ');
    document.writeln(' codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" ');
    document.writeln(' width="750" height="100" id="wprost_billboard" align="middle">');
    document.writeln('<param name="allowScriptAccess" value="always" />');
    document.writeln('<param name="movie" value="' + url + '" />');
    document.writeln('<param name="quality" value="high" />');
    document.writeln('<param name="play" value="true" />');
    document.writeln('<param name="wmode" value="transparent" />');
    document.writeln('<param name="menu" value="false" />');
    document.writeln('<param name="bgcolor" value="#000000" />');
    document.writeln('<embed src="' + url + '" quality="high" ');
    document.writeln(' menu="false" bgcolor="#000000" ');
    document.writeln(' wmode="transparent" width="750" height="100" ');
    document.writeln(' name="wprost_billboard" align="middle" ');
    document.writeln(' allowScriptAccess="always" type="application/x-shockwave-flash" ');
    document.writeln(' pluginspage="http://www.macromedia.com/go/getflashplayer" />');
    document.writeln('</object>');

}
var loadingImage = 'http://www.wprost.pl/G/icons/loading.gif';
var closeButton = 'http://www.wprost.pl/G/icons/lbox_close.gif';
function getPageScroll() {
    var yScroll;
    if (self.pageYOffset) {
        yScroll = self.pageYOffset;

    }
    else
    if (document.documentElement && document.documentElement.scrollTop) {
        yScroll = document.documentElement.scrollTop;

    }
    else
    if (document.body) {
        yScroll = document.body.scrollTop;

    }
    arrayPageScroll = new Array('', yScroll)
    return arrayPageScroll;

}
function getPageSize() {
    var xScroll,
    yScroll;
    if (window.innerHeight && window.scrollMaxY) {
        xScroll = document.body.scrollWidth;
        yScroll = window.innerHeight + window.scrollMaxY;

    }
    else
    if (document.body.scrollHeight > document.body.offsetHeight) {
        xScroll = document.body.scrollWidth;
        yScroll = document.body.scrollHeight;

    }
    else {
        xScroll = document.body.offsetWidth;
        yScroll = document.body.offsetHeight;

    }
    var windowWidth,
    windowHeight;
    if (self.innerHeight) {
        windowWidth = self.innerWidth;
        windowHeight = self.innerHeight;

    }
    else
    if (document.documentElement && document.documentElement.clientHeight) {
        windowWidth = document.documentElement.clientWidth;
        windowHeight = document.documentElement.clientHeight;

    }
    else
    if (document.body) {
        windowWidth = document.body.clientWidth;
        windowHeight = document.body.clientHeight;

    }
    if (yScroll < windowHeight) {
        pageHeight = windowHeight;

    }
    else {
        pageHeight = yScroll;

    }
    if (xScroll < windowWidth) {
        pageWidth = windowWidth;

    }
    else {
        pageWidth = xScroll;

    }
    arrayPageSize = new Array(pageWidth, pageHeight, windowWidth, windowHeight)
    return arrayPageSize;

}
function pause(numberMillis) {
    var now = new Date();
    var exitTime = now.getTime() + numberMillis;
    while (true) {
        now = new Date();
        if (now.getTime() > exitTime)
        return;

    }

}
function getKey(e) {
    if (e == null) {
        keycode = event.keyCode;

    }
    else {
        keycode = e.which;

    }
    key = String.fromCharCode(keycode).toLowerCase();
    if (key == 'x') {
        hideLightbox();

    }

}
function listenKey() {
    document.onkeypress = getKey;

}
function showLightbox(objLink) {
    var objOverlay = document.getElementById('overlay');
    var objLightbox = document.getElementById('lightbox');
    var objCaption = document.getElementById('lightboxCaption');
    var objImage = document.getElementById('lightboxImage');
    var objLoadingImage = document.getElementById('loadingImage');
    var objLightboxDetails = document.getElementById('lightboxDetails');
    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();
    if (objLoadingImage) {
        objLoadingImage.style.top = (arrayPageScroll[1] + ((arrayPageSize[3] - 35 - objLoadingImage.height) / 2) + 'px');
        objLoadingImage.style.left = (((arrayPageSize[0] - 20 - objLoadingImage.width) / 2) + 'px');
        objLoadingImage.style.display = 'block';

    }
    objOverlay.style.height = (arrayPageSize[1] + 'px');
    objOverlay.style.display = 'block';
    imgPreload = new Image();
    imgPreload.onload = function() {
        objImage.src = objLink.href;
        var lightboxTop = arrayPageScroll[1] + ((arrayPageSize[3] - 35 - imgPreload.height) / 2);
        var lightboxLeft = ((arrayPageSize[0] - 20 - imgPreload.width) / 2);
        objLightbox.style.top = (lightboxTop < 0) ? "0px": lightboxTop + "px";
        objLightbox.style.left = (lightboxLeft < 0) ? "0px": lightboxLeft + "px";
        objLightboxDetails.style.width = imgPreload.width + 'px';
        if (objLink.getAttribute('title')) {
            objCaption.style.display = 'block';
            objCaption.innerHTML = objLink.getAttribute('title');

        }
        else {
            objCaption.style.display = 'none';

        }
        if (navigator.appVersion.indexOf("MSIE") != -1) {
            pause(250);

        }
        if (objLoadingImage) {
            objLoadingImage.style.display = 'none';

        }
        selects = document.getElementsByTagName("select");
        for (i = 0; i != selects.length; i++) {
            selects[i].style.visibility = "hidden";
        }
        
    	var flashes = document.getElementsByTagName('object');
		for(var i = 0; i < flashes.length; i++)
		{
			var fl = flashes[i];
				fl.style.visibility = 'hidden';
		}
		
		imgBoxNextWP.style.position = 'absolute';
        imgBoxNextWP.style.top = Math.round((imgPreload.height-40)/3)+'px';
        
        imgBoxPrevWP.style.position = 'absolute';
        imgBoxPrevWP.style.top = Math.round((imgPreload.height-40)/3)+'px';
        
        objLightbox.style.display = 'block';
        arrayPageSize = getPageSize();
        objOverlay.style.height = (arrayPageSize[1] + 'px');
        listenKey();
        
        return false;

    }
    imgPreload.src = objLink.href;
    
    if(lightBoxAnchors.length <= 1)
    {
    	document.getElementById('lightboxImgNext').style.display = 'none';
    	document.getElementById('lightboxImgPrev').style.display = 'none';
    }
    else
    {
    	document.getElementById('lightboxImgNext').style.display = 'block';
    	document.getElementById('lightboxImgPrev').style.display = 'block';
    }

}
function hideLightbox() {
    objOverlay = document.getElementById('overlay');
    objLightbox = document.getElementById('lightbox');
    objOverlay.style.display = 'none';
    objLightbox.style.display = 'none';
    selects = document.getElementsByTagName("select");
    for (i = 0; i != selects.length; i++) {
        selects[i].style.visibility = "visible";
    }
    
    var flashes = document.getElementsByTagName('object');
	for(var i = 0; i < flashes.length; i++)
	{
		var fl = flashes[i];
		
			fl.style.visibility = 'visible';
		
	}
    
    document.onkeypress = '';

}

var lightBoxAnchors = [];
var lightBoxAnchorNumber = 0;

function initLightbox() {
    if (!document.getElementsByTagName) {
        return;

    }
    var anchors = document.getElementsByTagName("a");
    for (var i = 0; i < anchors.length; i++) {
        var anchor = anchors[i];
        if (anchor.getAttribute("href") && (anchor.getAttribute("rel") == "lightbox")) {
        	lightBoxAnchors[lightBoxAnchors.length] = anchor;
            anchor.onclick = function() {
                showLightbox(this);
                return false;

            }

        }

    }
    var objBody = document.getElementsByTagName("body").item(0);
    var objOverlay = document.createElement("div");
    objOverlay.setAttribute('id', 'overlay');
    objOverlay.onclick = function() {
        hideLightbox();
        return false;

    }
    objOverlay.style.display = 'none';
    objOverlay.style.position = 'absolute';
    objOverlay.style.top = '0';
    objOverlay.style.left = '0';
    objOverlay.style.zIndex = '9990';
    objOverlay.style.width = '100%';
    objBody.insertBefore(objOverlay, objBody.firstChild);
    var arrayPageSize = getPageSize();
    var arrayPageScroll = getPageScroll();
    var imgPreloader = new Image();
    
    imgPreloader.onload = function() {
        var objLoadingImageLink = document.createElement("a");
        objLoadingImageLink.setAttribute('href', '#');
        objLoadingImageLink.onclick = function() {
            hideLightbox();
            return false;

        }
        objOverlay.appendChild(objLoadingImageLink);
        var objLoadingImage = document.createElement("img");
        objLoadingImage.src = loadingImage;
        objLoadingImage.setAttribute('id', 'loadingImage');
        objLoadingImage.style.position = 'absolute';
        objLoadingImage.style.zIndex = '150';
        objLoadingImageLink.appendChild(objLoadingImage);
        imgPreloader.onload = function() {};
        
        if (imgBoxNextWP) imgBoxNextWP.style.top = (imgPreloader.height-40)/3+'px';
        if (imgBoxPrevWP) imgBoxPrevWP.style.top = (imgPreloader.height-40)/3+'px';
        return false;

    }
    imgPreloader.src = loadingImage;
    var objLightbox = document.createElement("div");
    objLightbox.setAttribute('id', 'lightbox');
    objLightbox.style.display = 'none';
    objLightbox.style.position = 'absolute';
    objLightbox.style.zIndex = '9999';
    
    /*
     * ARROWS! 
     */
    
    imgBoxNextWP = document.createElement('a');
    imgBoxNextWP.setAttribute('id','lightboxImgNext');
	imgBoxNextWP.innerHTML = imgNastepnyZawartosc;
	//imgBoxNextWP.style.float = 'right;'
	//imgBoxNextWP.style.paddingLeft = '10px';
	imgBoxNextWP.style.display = 'block';
	imgBoxNextWP.style.width = '40px';
	imgBoxNextWP.style.height = '40px';
	imgBoxNextWP.style.position = 'absolute';
	//imgBoxNextWP.style.top = '10px';
	imgBoxNextWP.style.right = '0px';
	
	imgBoxNextWP.onclick = function()
	{
		if(lightBoxAnchorNumber+1 < lightBoxAnchors.length)
		{
			lightBoxAnchorNumber++;
		}
		else
		{
			lightBoxAnchorNumber = 0;
		}
		
		showLightbox(lightBoxAnchors[lightBoxAnchorNumber]);
		
		return false;
	};
	
	imgBoxPrevWP = document.createElement('a');
	imgBoxPrevWP.setAttribute('id','lightboxImgPrev');
	imgBoxPrevWP.innerHTML = imgPoprzedniZawartosc;
	//imgBoxPrevWP.style.float = 'left';
	imgBoxPrevWP.style.display = 'block';
	imgBoxPrevWP.style.width = '40px';
	imgBoxPrevWP.style.height = '40px';
	imgBoxPrevWP.style.position = 'absolute';
	//imgBoxPrevWP.style.top = '10px';
	imgBoxPrevWP.style.left = '0px';
	
	imgBoxPrevWP.onclick = function()
	{
		if(lightBoxAnchorNumber > 0)
		{
			lightBoxAnchorNumber--;
		}
		else
		{
			lightBoxAnchorNumber = lightBoxAnchors.length-1;
		}
		
		showLightbox(lightBoxAnchors[lightBoxAnchorNumber]);
		
		return false;
	};
	
	var clearingDiv = document.createElement('div');
	clearingDiv.style.clear = 'both';
	
	objLightbox.appendChild(imgBoxPrevWP);
	objLightbox.appendChild(imgBoxNextWP);
	objLightbox.appendChild(clearingDiv);
	
	/*
	 * END ARROWS
	 */
    
    objBody.insertBefore(objLightbox, objOverlay.nextSibling);
    var objLink = document.createElement("a");
    objLink.setAttribute('href', '#');
    objLink.setAttribute('title', 'Kliknij aby zamknąć');
    objLink.onclick = function() {
        hideLightbox();
        return false;

    }
    objLightbox.appendChild(objLink);
    var imgPreloadCloseButton = new Image();
    imgPreloadCloseButton.onload = function() {
        var objCloseButton = document.createElement("img");
        objCloseButton.src = closeButton;
        objCloseButton.setAttribute('id', 'closeButton');
        objCloseButton.style.position = 'absolute';
        objCloseButton.style.zIndex = '200';
        objLink.appendChild(objCloseButton);
        return false;

    }
    imgPreloadCloseButton.src = closeButton;
    var objImage = document.createElement("img");
    objImage.setAttribute('id', 'lightboxImage');
    objLink.appendChild(objImage);
    var objLightboxDetails = document.createElement("div");
    objLightboxDetails.setAttribute('id', 'lightboxDetails');
    objLightbox.appendChild(objLightboxDetails);
    var objCaption = document.createElement("div");
    objCaption.setAttribute('id', 'lightboxCaption');
    objCaption.style.display = 'none';
    objLightboxDetails.appendChild(objCaption);
    var objKeyboardMsg = document.createElement("div");
    objKeyboardMsg.setAttribute('id', 'keyboardMsg');
    objKeyboardMsg.innerHTML = '';
    objLightboxDetails.appendChild(objKeyboardMsg);

}
function addLoadEvent(func) {
    var oldonload = window.onload;
    if (typeof window.onload != 'function') {
        window.onload = func;

    }
    else {
        window.onload = function() {
            oldonload();
            func();

        }

    }

}
//addLoadEvent(initLightbox);
obr = 0;
obr = null;
function zoom(src, w, h) {
    if (window.screen) {
        aw = screen.availWidth;
        ah = screen.availHeight;

    } else {
        aw = 640;
        ah = 450;

    }
    if (obr == null || obr.closed) {
        ustawienia =
        "left=" + (aw - w) / 2 + ","
        + "top=" + (ah - h) / 2 + ","
        + "screenX=" + (aw - w) / 2 + ","
        + "screenY=" + (ah - h) / 2 + ","
        + "width=" + w + ","
        + "height=" + h + ","
        + "innerWidth=" + w + ","
        + "innerHeight=" + h + ","
        + "toolbar=no,"
        + "location=no,"
        + "directories=no,"
        + "status=no,"
        + "menubar=no,"
        + "scrollbars=no,"
        + "resizable=no"
        obr = window.open('', 'obrazek', ustawienia);
        obr.document.writeln("<html><head>\n"
        + "<meta http-equiv=\"refresh\" content=\"no-cache\">\n"
        + "<title>BusinessWeek - Okładka</title>\n"
        + "<style type=\"text/css\">BODY { background : url(\"" + src + "\") no-repeat;\n"
        + "background-image : url(\"" + src + "\"); background-repeat : no-repeat;}</style>\n"
        + "</body></html>");

    }
    obr.document.clear();
    obr.document.close();
    obr.focus();

}
function check_login() {
    if (document.l.LN.value == '') {
        alert('Musisz podać nick aby się zalogować!');
        document.l.LN.focus();
        return (false);

    }
    if (document.l.LP.value == '') {
        alert('Musisz wpisać hasło do logowania na forum!');
        document.l.LP.focus();
        return (false);

    }
    return (true);

}
function check_login2() {
    if (document.l2.LN.value == '') {
        alert('Musisz podać nick aby się zalogować!');
        document.l2.LN.focus();
        return (false);

    }
    if (document.l2.LP.value == '') {
        alert('Musisz wpisać hasło do logowania na forum!');
        document.l2.LP.focus();
        return (false);

    }
    return (true);

}
function check_email() {
    Wzor_email = /^[0-9a-zA-Z._-]+\@([0-9a-zA-Z-]+\.)+[0-9a-zA-Z]{2,4}$/;
    if (!Wzor_email.test(this.document.p.email.value)) {
        alert('Musisz podać poprawny adres email!');
        document.p.email.focus();
        return (false);

    }
    document.p.submit();

}
function check_subs() {
    Wzor_email = /^[0-9a-zA-Z._-]+\@([0-9a-zA-Z-]+\.)+[0-9a-zA-Z]{2,4}$/;
    if (!Wzor_email.test(document.subs.M.value)) {
        alert('Musisz podać poprawny adres email!');
        document.subs.M.focus();
        return (false);

    }
    return (true);

}
function check_uwagi() {
    if (document.uwaga.osoba.value == '') {
        alert('Musisz podać swoje imię i nazwisko!');
        document.uwaga.osoba.focus();
        return (false);

    }
    Wzor_email = /^[0-9a-zA-Z._-]+\@([0-9a-zA-Z-]+\.)+[0-9a-zA-Z]{2,4}$/;
    if (!Wzor_email.test(this.document.uwaga.email.value)) {
        alert('Musisz podać poprawny adres email!');
        document.uwaga.email.focus();
        return (false);

    }
    if (document.uwaga.tresc.value == '') {
        alert('Musisz wpisać uwagę!');
        document.uwaga.tresc.focus();
        return (false);

    }
    document.uwaga.submit();

}
function check_zamow() {
    if (document.zamow.imie.value == '') {
        alert('Musisz podać swoje imię!');
        document.zamow.imie.focus();
        return (false);

    }
    if (document.zamow.nazwisko.value == '') {
        alert('Musisz podać swoje nazwisko!');
        document.zamow.nazwisko.focus();
        return (false);

    }
    if (document.zamow.ulica.value == '') {
        alert('Musisz wpisać ulicę!');
        document.zamow.ulica.focus();
        return (false);

    }
    if (document.zamow.numer_domu.value == '') {
        alert('Musisz wpisać numer domu!');
        document.zamow.numer_domu.focus();
        return (false);

    }
    if (document.zamow.kod.value == '') {
        alert('Musisz wpisać numer kodu!');
        document.zamow.kod.focus();
        return (false);

    }
    if (document.zamow.miasto.value == '') {
        alert('Musisz wpisać miasto!');
        document.zamow.miasto.focus();
        return (false);

    }
    Wzor_email = /^[0-9a-zA-Z._-]+\@([0-9a-zA-Z-]+\.)+[0-9a-zA-Z]{2,4}$/;
    if (!Wzor_email.test(this.document.zamow.email.value)) {
        alert('Musisz podać poprawny adres email!');
        document.zamow.email.focus();
        return (false);

    }
    if (document.zamow.telefon.value == '') {
        alert('Musisz wpisać numer telefonu!');
        document.zamow.telefon.focus();
        return (false);

    }
    document.zamow.submit();

}
function checkCheckBoxForm(forma, num) {
    glosowanie = 0;

    for (i = 0; i < document.forms[forma].elements.length; i++) {

        if (document.forms[forma].elements[i].type == "checkbox") {

            if (document.forms[forma].elements[i].checked == true) {

                glosowanie = glosowanie + 1;


            }


        }


    }

    if (glosowanie != num) {

        alert('Zaznacz ' + num + ' odpowiedzi z listy!');

        return (false);


    }

}


/// submenu /////////////////////////////////////////////
  function getElementX( oElement )
    {
        var iReturnValue = 0;
        while( oElement != null )
        {
            iReturnValue += oElement.offsetLeft;
            oElement = oElement.offsetParent;
        }
        return iReturnValue;
    }

    function getElementY( oElement )
    {
        var iReturnValue = 0;
        while( oElement != null )
        {
            iReturnValue += oElement.offsetTop;
            oElement = oElement.offsetParent;
        }
        return iReturnValue;
    }

    var hideTimeout;

    function ShowServicesList(w){
        var warstwa = document.getElementById(w);
        var ramka = document.getElementById('iframe1');
        var ie = navigator.appVersion.indexOf('MSIE') != -1;

        if(warstwa.style.visibility == 'hidden')
        {
            ramka.style.display="block";
            ramka.style.top = getElementY(warstwa)+'px';
            ramka.style.left = getElementX(warstwa)+'px';
            ramka.style.width = warstwa.offsetWidth+'px';
            ramka.style.height = warstwa.offsetHeight+'px';
            ramka.style.visibility = 'visible';

            document.getElementById('ServicesLink').parentNode.style.zIndex = 1000000;

            warstwa.style.visibility = 'visible';

            if(ie)
            {
                ramka.style.visibility = 'hidden';
            }

            hideTimeout = setTimeout("ShowServicesList('ServicesList')", 10000);
        }
        else
        {
        	document.getElementById('ServicesLink').parentNode.style.zIndex = 1999;

            warstwa.style.visibility = 'hidden';

            ramka.style.display="none";
            ramka.style.width = '0px';
            ramka.style.height = '0px';
            ramka.style.left = '0px';
            ramka.style.top = '0px';
            ramka.style.visibility = 'hidden';

            clearTimeout(hideTimeout);
        }
    }

    function show_hide_DIV(div, element) {
    obj_div = document.getElementById(div);
    obj_el = document.getElementById(element);
        if (!(!obj_div)){
			if (obj_div.style.display == 'none'){
				obj_div.style.display = 'block';
				obj_el.className = 'arrow-up wszystkie def';
			} else {
				obj_div.style.display = 'none';
				obj_el.className = 'arrow-down wszystkie def';
			}
		}
}

function show_hide_DIV_rasowi(div) {
    obj_div = document.getElementById(div);
        if (!(!obj_div)){
			if (obj_div.style.display == 'none'){
				obj_div.style.display = 'block';
			} else {
				obj_div.style.display = 'none';
			}
		}
}

function show_hide_DIV_next(div, el){
	//alert(el);
    obj_div = document.getElementById(div);
    obj_el = document.getElementById(el);
        if (!(!obj_div)){
			if (obj_div.style.display == 'none'){
				obj_div.style.display = 'block';
				obj_el.innerHTML = 'ukryj';
			} else {
				obj_div.style.display = 'none';
				obj_el.innerHTML = 'więcej';
			}
		}
}

function onSubmitTopSearchForm(){
	if (document.searchform.q.value.length < 2){
		alert('Fraza musi mieć conajmniej 3 znaki!');
		return(false);
	} else {
		document.searchform.submit();
	}
}

function zobacz_wyniki_ankiety(id_ankieta){
	var req_ank = mint.Request();
	req_ank.AddParam("id_ankieta", id_ankieta)
	req_ank.OnSuccess = function(){
		$M("ajaxankieta").innerHTML = this.responseText;
	}
	req_ank.Send("/F/ajax/ankieta.php");
}

function wyslijPolecStrone(){
	var req = mint.Request();
	req.OnSuccess = function(){
		$M("polec_strone_main_content").innerHTML = this.responseText;
	}
	req.SendForm("polec_strone_form", "/F/ajax/polec_strone.php");
}

function openPolecStrone(div){
	var top = (screen.height - 300) / 2;
	top = top + 'px';
	var left = (screen.width - 356) / 2;
	left = left + 'px';
    obj_div = document.getElementById(div);
        if (!(!obj_div)){
			if (obj_div.style.display == 'none'){
				obj_div.style.display = 'block';
				obj_div.style.top = top;
				obj_div.style.left = left;
			} else {
				obj_div.style.display = 'none';
			}
		}
}

function checkFormPolecStroneFields(element){
	//alert (document.forms['polec_strone_form'].elements['od_nazwa'].value);
	if (element.name != "od_nazwa"){
		if (document.forms['polec_strone_form'].elements['od_nazwa'].value == ""){
		//alert ('test');
			document.forms['polec_strone_form'].elements['od_nazwa'].value == "imię nazwisko / nick";
		}
	}
}

function polecStrone(){
	//alert (document.forms['polec_strone_form'].elements['do_mail'].value);
	var email = document.forms['polec_strone_form'].elements['do_mail'].value;
	var nazwa = document.forms['polec_strone_form'].elements['do_nazwa'].value;
	var od_email = document.forms['polec_strone_form'].elements['od_mail'].value;
	var ok = 1;

	if (email.indexOf('@') < 1 ){
		alert('Proszę podać poprawny adres email odbiorcy.');
		ok = 0;
	} else if (email.length < 5){
		alert('Proszę podać poprawny adres email odbiorcy.');
		ok = 0;
	} else if (nazwa.length < 2){
		alert('Proszę podać informację komu polecasz link.');
		ok = 0;
	} else if (nazwa == "imię nazwisko / nick"){
		alert('Proszę podać informację komu polecasz link.');
		ok = 0;
	} else if (od_email.indexOf('@') < 1 ){
		alert('Proszę podać poprawny adres email nadawcy.');
		ok = 0;
	} else if (od_email.length < 5){
		alert('Proszę podać poprawny adres email nadawcy.');
		ok = 0;
	}
	if (ok == 1){
		//openPolecStrone('polec_strone_div');
		wyslijPolecStrone();
	}
}

function ocenTrafnosc(id_element, ocena){
	//alert('ocena - ' + ocena);
	var req_ot = mint.Request();
	req_ot.AddParam("element", id_element);
	req_ot.AddParam("ocena", ocena);
	document.getElementById('ikony_oceny_trafnosci').disabled = true;
	req_ot.OnSuccess = function(){
		if (ocena == 1){
			$M("ocen_na_tak").innerHTML = this.responseText;
		} else {
			$M("ocen_na_nie").innerHTML = this.responseText;
		}
		document.getElementById('ikony_oceny_trafnosci').style.display = 'none';
		document.getElementById('zobacz_oceny_trafnosci_span').style.display = 'none';
		document.getElementById('oceny_trafnosci').style.display = 'block';
		document.getElementById('oceny_trafnosci_title').innerHTML = 'Oceny trafności';
	}
	req_ot.OnError = function (){
    	document.getElementById('ikony_oceny_trafnosci').disabled = false;
    }
    req_ot.OnTimeout = function (){
    	document.getElementById('ikony_oceny_trafnosci').disabled = false;
    }
	req_ot.Send("/F/ajax/ocena_trafnosci.php");
}


// strona glowna
   function select1(){
        document.getElementById('topboxli1').className = "first-selected";
        document.getElementById('topboxli2').className = "inback";
        document.getElementById('topboxli3').className = "inback";
        document.getElementById('atopboxli1').className = "selected";
        document.getElementById('atopboxli2').className = "";
        document.getElementById('atopboxli3').className = "";
        unhide_block('hits_selected1');
        hide_block('hits_selected2');
        hide_block('hits_selected3');
        hide_block('hits_selected4');
        document.getElementById('topboxli4').className = "inback";
        document.getElementById('atopboxli4').className = "";

    }

    function select2(){
        document.getElementById('topboxli1').className = "first-inback";
        document.getElementById('topboxli2').className = "selected";
        document.getElementById('topboxli3').className = "inback";
        document.getElementById('atopboxli1').className = "";
        document.getElementById('atopboxli2').className = "selected";
        document.getElementById('atopboxli3').className = "";
        hide_block('hits_selected1');
        unhide_block('hits_selected2');
        hide_block('hits_selected3');
        hide_block('hits_selected4');
        document.getElementById('topboxli4').className = "inback";
        document.getElementById('atopboxli4').className = "";
    }

    function select3(){
        document.getElementById('topboxli1').className = "first-inback";
        document.getElementById('topboxli2').className = "inback";
        document.getElementById('topboxli3').className = "selected";
        document.getElementById('atopboxli1').className = "";
        document.getElementById('atopboxli2').className = "";
        document.getElementById('atopboxli3').className = "selected";
        hide_block('hits_selected1');
        hide_block('hits_selected2');
        unhide_block('hits_selected3');
        hide_block('hits_selected4');
        document.getElementById('topboxli4').className = "inback";
        document.getElementById('atopboxli4').className = "";
    }

    function select4(){
        document.getElementById('topboxli1').className = "first-inback";
        document.getElementById('topboxli2').className = "inback";
        document.getElementById('topboxli3').className = "inback";
        document.getElementById('topboxli4').className = "selected";
        document.getElementById('atopboxli1').className = "";
        document.getElementById('atopboxli2').className = "";
        document.getElementById('atopboxli3').className = "";
        document.getElementById('atopboxli4').className = "selected";
        hide_block('hits_selected1');
        hide_block('hits_selected2');
        hide_block('hits_selected3');
        unhide_block('hits_selected4');
    }

    var setSelector = ".dragableBoxesColumn";
    var setCookieName = "dragableBoxesOrder";
    var setCookieExpiry = 31;


    function setOrder() {
        var pos = [];
        jQuery(setSelector).each(function(){	pos.push(jQuery(this).sortable("toArray"));	})
        jQuery.cookie(setCookieName, pos.join("|"), { expires: setCookieExpiry, path: "/" });
    }
    function restoreOrder() {
        var cookie = jQuery.cookie(setCookieName);	if (!cookie) return;
        var colms = cookie.split("|");
        var allitems = new Array();
        jQuery(setSelector).each(function(){
            var list = jQuery(this); if (list == null) return
            var IDs = colms.shift().split(",");
            var items = list.sortable("toArray");
            for ( var v=0, len=IDs.length; v<len; v++ ){
                allitems.push(jQuery("div.ui-sortable").children("#" + IDs[v]));
                jQuery("div.ui-sortable").children("#" + IDs[v]).remove();
            }
        })

        var colms = cookie.split("|");
        jQuery(setSelector).each(function(){
            var list = jQuery(this); if (list == null) return
            var IDs = colms.shift().split(",");
            var items = list.sortable("toArray");
            var rebuild = new Array();
            for ( var v=0, len=IDs.length; v<len; v++ ){
                list.append(allitems.shift());
            }
        });
    }


    function boxToggle(boxid){
        var el = $("#dbody_"+boxid);
            jQuery(".dragableBoxesColumn").css('min-height',1000);
            el.toggle(500,function(){
            updateCookie( el );
            jQuery(".dragableBoxesColumn").css('min-height',jQuery("#floatBox").height());
        });
    }

    function boxHideRestore(){
        var cookie = $.cookie("hiddenBox");
        var hidden = cookie ? cookie.split("|") : [];
        $.each( hidden, function(){
            var pid = this;
            $('#' + pid).hide();
        })
    }
    function updateCookie(el){
        var cookie = $.cookie("hiddenBox");
        var hidden = cookie ? cookie.split("|") : [];
        var cookieExpires = 31;

        var indx = el.attr('id');
        var tmp = hidden.getUnique();
        if (el.is(':hidden')) {
            tmp.push(indx);
        } else {
            tmp.splice( tmp.indexOf(indx) , 1);
        }
        hidden = tmp.getUnique();
        $.cookie("hiddenBox", hidden.join('|'), { expires: cookieExpires } );
    }

    Array.prototype.getUnique = function() {
        var o = new Object();
        var i, e;
        for (i = 0; e = this[i]; i++) {o[e] = 1};
        var a = new Array();
        for (e in o) {a.push (e)};
        return a;
    }
    // Fix indexOf in IE
    if (!Array.prototype.indexOf) {
        Array.prototype.indexOf = function(obj, start) {
            for (var i = (start || 0), j = this.length; i < j; i++) {
                if (this[i] == obj) { return i; }
            }
            return -1;
        }
    }


function equalHeight(group) {
	var tallest = 0;
	group.each(function() {
		var thisHeight = $(this).height();
		if(thisHeight > tallest) {
			tallest = thisHeight;
		}
	});
	group.height(tallest);
}


//////////////////////////////////////////////////////////
/*
 * -- grayscale.js --
 * Copyright (C) James Padolsey (http://james.padolsey.com)
 *
 */

var grayscale = (function(){

    var config = {
            colorProps: ['color','backgroundColor','borderBottomColor','borderTopColor','borderLeftColor','borderRightColor','backgroundImage'],
            externalImageHandler : {
                /* Grayscaling externally hosted images does not work
                   - Use these functions to handle those images as you so desire */
                /* Out of convenience these functions are also used for browsers
                   like Chrome that do not support CanvasContext.getImageData */
                init : function(el, src) {
                    if (el.nodeName.toLowerCase() === 'img') {
                        // Is IMG element...
                    } else {
                        // Is background-image element:
                        // Default - remove background images
                        data(el).backgroundImageSRC = src;
                        el.style.backgroundImage = '';
                    }
                },
                reset : function(el) {
                    if (el.nodeName.toLowerCase() === 'img') {
                        // Is IMG element...
                    } else {
                        // Is background-image element:
                        el.style.backgroundImage = 'url(' + (data(el).backgroundImageSRC || '') + ')';
                    }
                }
            }
        },
        log = function(){
            try { window.console.log.apply(console, arguments); }
            catch(e) {};
        },
        isExternal = function(url) {
            // Checks whether URL is external: 'CanvasContext.getImageData'
            // only works if the image is on the current domain.
            return (new RegExp('https?://(?!' + window.location.hostname + ')')).test(url);
        },
        data = (function(){

            var cache = [0],
            expando = 'data' + (+new Date());

            return function(elem) {
                var cacheIndex = elem[expando],
                    nextCacheIndex = cache.length;
                if(!cacheIndex) {
                    cacheIndex = elem[expando] = nextCacheIndex;
                    cache[cacheIndex] = {};
                }
                return cache[cacheIndex];
            };

        })(),
        desatIMG = function(img, prepare, realEl) {

            // realEl is only set when img is temp (for BG images)

            var canvas = document.createElement('canvas'),
                context = canvas.getContext('2d'),
                height = img.naturalHeight || img.offsetHeight || img.height,
                width = img.naturalWidth || img.offsetWidth || img.width,
                imgData;

            canvas.height = height;
            canvas.width = width;
            context.drawImage(img, 0, 0);
            try {
                imgData = context.getImageData(0, 0, width, height);
            } catch(e) {}

            if (prepare) {
                desatIMG.preparing = true;
                // Slowly recurse through pixels for prep,
                // :: only occurs on grayscale.prepare()
                var y = 0;
                (function(){

                    if (!desatIMG.preparing) { return; }

                    if (y === height) {
                        // Finished!
                        context.putImageData(imgData, 0, 0, 0, 0, width, height);
                        realEl ? (data(realEl).BGdataURL = canvas.toDataURL())
                               : (data(img).dataURL = canvas.toDataURL())
                    }

                    for (var x = 0; x < width; x++) {
                        var i = (y * width + x) * 4;
                        // Apply Monoschrome level across all channels:
                        imgData.data[i] = imgData.data[i+1] = imgData.data[i+2] =
                        RGBtoGRAYSCALE(imgData.data[i], imgData.data[i+1], imgData.data[i+2]);
                    }

                    y++;
                    setTimeout(arguments.callee, 0);

                })();
                return;
            } else {
                // If desatIMG was called without 'prepare' flag
                // then cancel recursion and proceed with force! (below)
                desatIMG.preparing = false;
            }

            for (var y = 0; y < height; y++) {
                for (var x = 0; x < width; x++) {
                    var i = (y * width + x) * 4;
                    // Apply Monoschrome level across all channels:
                    imgData.data[i] = imgData.data[i+1] = imgData.data[i+2] =
                    RGBtoGRAYSCALE(imgData.data[i], imgData.data[i+1], imgData.data[i+2]);
                }
            }

            context.putImageData(imgData, 0, 0, 0, 0, width, height);
            return canvas;

        },
        getStyle = function(el, prop) {
            var style = document.defaultView && document.defaultView.getComputedStyle ?
                        document.defaultView.getComputedStyle(el, null)[prop]
                        : el.currentStyle[prop];
            // If format is #FFFFFF: (convert to RGB)
            if (style && /^#[A-F0-9]/i.test(style)) {
                    var hex = style.match(/[A-F0-9]{2}/ig);
                    style = 'rgb(' + parseInt(hex[0], 16) + ','
                                   + parseInt(hex[1], 16) + ','
                                   + parseInt(hex[2], 16) + ')';
            }
            return style;
        },
        RGBtoGRAYSCALE = function(r,g,b) {
            // Returns single monochrome figure:
            return parseInt( (0.2125 * r) + (0.7154 * g) + (0.0721 * b), 10 );
        },
        getAllNodes = function(context) {
            var all = Array.prototype.slice.call(context.getElementsByTagName('*'));
            all.unshift(context);
            return all;
        };

    var init = function(context) {

        // Handle if a DOM collection is passed instead of a single el:
        if (context && context[0] && context.length && context[0].nodeName) {
            // Is a DOM collection:
            var allContexts = Array.prototype.slice.call(context),
                cIndex = -1, cLen = allContexts.length;
            while (++cIndex<cLen) { init.call(this, allContexts[cIndex]); }
            return;
        }

        context = context || document.documentElement;

        if (!document.createElement('canvas').getContext) {
            context.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(grayscale=1)';
            context.style.zoom = 1;
            return;
        }

        var all = getAllNodes(context),
            i = -1, len = all.length;

        while (++i<len) {
            var cur = all[i];

            if (cur.nodeName.toLowerCase() === 'img') {
                var src = cur.getAttribute('src');
                if(!src) { continue; }
                if (isExternal(src)) {
                    config.externalImageHandler.init(cur, src);
                } else {
                    data(cur).realSRC = src;
                    try {
                        // Within try statement just encase there's no support....
                        cur.src = data(cur).dataURL || desatIMG(cur).toDataURL();
                    } catch(e) { config.externalImageHandler.init(cur, src); }
                }

            } else {
                for (var pIndex = 0, pLen = config.colorProps.length; pIndex < pLen; pIndex++) {
                    var prop = config.colorProps[pIndex],
                    style = getStyle(cur, prop);
                    if (!style) {continue;}
                    if (cur.style[prop]) {
                        data(cur)[prop] = style;
                    }
                    // RGB color:
                    if (style.substring(0,4) === 'rgb(') {
                        var monoRGB = RGBtoGRAYSCALE.apply(null, style.match(/\d+/g));
                        cur.style[prop] = style = 'rgb(' + monoRGB + ',' + monoRGB + ',' + monoRGB + ')';
                        continue;
                    }
                    // Background Image:
                    if (style.indexOf('url(') > -1) {
                        var urlPatt = /\(['"]?(.+?)['"]?\)/,
                            url = style.match(urlPatt)[1];
                        if (isExternal(url)) {
                            config.externalImageHandler.init(cur, url);
                            data(cur).externalBG = true;
                            continue;
                        }
                        // data(cur).BGdataURL refers to caches URL (from preparation)
                        try {
                            var imgSRC = data(cur).BGdataURL || (function(){
                                    var temp = document.createElement('img');
                                    temp.src = url;
                                    return desatIMG(temp).toDataURL();
                                })();

                            cur.style[prop] = style.replace(urlPatt, function(_, url){
                                return '(' + imgSRC + ')';
                            });
                        } catch(e) { config.externalImageHandler.init(cur, url); }
                    }
                }
            }
        }

    };

    init.reset = function(context) {
        // Handle if a DOM collection is passed instead of a single el:
        if (context && context[0] && context.length && context[0].nodeName) {
            // Is a DOM collection:
            var allContexts = Array.prototype.slice.call(context),
                cIndex = -1, cLen = allContexts.length;
            while (++cIndex<cLen) { init.reset.call(this, allContexts[cIndex]); }
            return;
        }
        context = context || document.documentElement;
        if (!document.createElement('canvas').getContext) {
            context.style.filter = 'progid:DXImageTransform.Microsoft.BasicImage(grayscale=0)';
            return;
        }
        var all = getAllNodes(context),
            i = -1, len = all.length;
        while (++i<len) {
            var cur = all[i];
            if (cur.nodeName.toLowerCase() === 'img') {
                var src = cur.getAttribute('src');
                if (isExternal(src)) {
                    config.externalImageHandler.reset(cur, src);
                }
                cur.src = data(cur).realSRC || src;
            } else {
                for (var pIndex = 0, pLen = config.colorProps.length; pIndex < pLen; pIndex++) {
                    if (data(cur).externalBG) {
                        config.externalImageHandler.reset(cur);
                    }
                    var prop = config.colorProps[pIndex];
                    cur.style[prop] = data(cur)[prop] || '';
                }
            }
        }
    };

    init.prepare = function(context) {

        // Handle if a DOM collection is passed instead of a single el:
        if (context && context[0] && context.length && context[0].nodeName) {
            // Is a DOM collection:
            var allContexts = Array.prototype.slice.call(context),
                cIndex = -1, cLen = allContexts.length;
            while (++cIndex<cLen) { init.prepare.call(null, allContexts[cIndex]); }
            return;
        }

        // Slowly recurses through all elements
        // so as not to lock up on the user.

        context = context || document.documentElement;

        if (!document.createElement('canvas').getContext) { return; }

        var all = getAllNodes(context),
            i = -1, len = all.length;

        while (++i<len) {
            var cur = all[i];
            if (data(cur).skip) { return; }
            if (cur.nodeName.toLowerCase() === 'img') {
                if (cur.getAttribute('src') && !isExternal(cur.src)) {
                    desatIMG(cur, true);
                }

            } else {
                var style = getStyle(cur, 'backgroundImage');
                if (style.indexOf('url(') > -1) {
                    var urlPatt = /\(['"]?(.+?)['"]?\)/,
                        url = style.match(urlPatt)[1];
                    if (!isExternal(url)) {
                        var temp = document.createElement('img');
                        temp.src = url;
                        desatIMG(temp, true, cur);
                    }
                }
            }
        }
    };

    return init;

})();



// jFav, JQuery plugin
// v 1.0
// SAFARI & CHROME not Supported!
// Licensed under GPL licenses.
// Copyright (C) 2008 Nikos "DuMmWiaM" Kontis, info@dummwiam.com
// http://www.DuMmWiaM.com/EffectChain
// ----------------------------------------------------------------------------
// Permission is hereby granted, free of charge, to any person obtaining a copy
// of this software and associated documentation files (the "Software"), to deal
// in the Software without restriction, including without limitation the rights
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
// copies of the Software, and to permit persons to whom the Software is
// furnished to do so, subject to the following conditions:
//
// The above copyright notice and this permission notice shall be included in
// all copies or substantial portions of the Software.
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
// THE SOFTWARE.
// ----------------------------------------------------------------------------
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('(7($){$.8.9=7(d){g e=$.v({},$.8.9.k,d);g f=e.l;2.w(7(){5(!$(2).3(\'4\')||$(2).3(\'4\')=="#"){$(2).3(\'4\',j.x.4)}5(!$(2).3(\'6\')){$(2).3(\'6\',y.6)}5($.h.z){$(2).3(\'m\',$(2).3(\'4\')).3(\'4\',\'\').3(\'4\',\'A:B(0)\').3(\'C\',\'$.8.9.n(2,"\'+$(2).3(\'6\')+\'","\'+$(2).3(\'m\')+\'")\')}i{$(2).o(p)}});7 p(a){g b=$(2).3(\'4\');g c=$(2).3(\'6\');b=b.E("q:///","F://q/");5($.h.G){j.H.I(b,c)}i 5($.h.J){j.r.K(c,b,\'\')}i 5(L.M.N().O(\'P\')>-1){s(f)}i 5($.h.Q){s(f)}a.R()};t 2};$.8.9.k={l:\'S "T + D" U "V + D" W X, u Y 2 Z u 10 11.\'};$.8.9.n=7(e,a,b){e.12="r";e.6=a;e.4="";e.4=b;e.o();t 13}})(14);',62,67,'||this|attr|href|if|title|function|fn|jFav|||||||var|browser|else|window|defaults|msg|link|OperaBookmark|click|addToFavorites|file|sidebar|alert|return|to|extend|each|location|document|opera|javascript|void|onClick||replace|http|msie|external|AddFavorite|mozilla|addPanel|navigator|userAgent|toLowerCase|indexOf|chrome|safari|preventDefault|Press|Ctrl|or|CMD|for|MAC|add|page|your|bookmarks|rel|false|jQuery'.split('|'),0,{}))


