﻿jQuery.preloadImages = function() {
    for (var i = 0; i < arguments.length; i++) {
        jQuery("<img>").attr("src", arguments[i]);
    }
}
String.prototype.endsWith = function(str)
{return (this.match(str+"$")==str)}

jQuery(document).ready(function() {

    jQuery(".roll-over").hover(
        function() {
            var img = jQuery(this).children("img");
            var src = img.attr("src");
            src = src.substring(0, src.length - 4) + "-over" + src.substring(src.length - 4, src.length);
            img.attr("src", src);
        },
        function() {
            var img = jQuery(this).children("img");
            var src = img.attr("src").replace("-over", "");
            img.attr("src", src);
        }
    );

});

function email() {
ML=">=lscoa:</rn\"@imgh p.tef";
MI="86BA:FG1<?6>2E57>;G5=3EFCAF;@6EED45?<0>;G5=3EFCAF;@6EED45?8960";
OT="";
for(j=0;j<MI.length;j++){
OT+=ML.charAt(MI.charCodeAt(j)-48);
}document.write(OT);
}

var bannerIndex = 1;
var bannerInterval;

jQuery(document).ready(function() {
    bannerInterval = setInterval("rotateBanner()", 5000);
});

function rotateBanner() {

    var index;
    do {
        index = Math.floor(Math.random() * adList.length);
    } while (jQuery("#ads li.ad-" + adList[index].id).length > 0);

    // li tag
    var li = jQuery("#ads li:nth-child(" + bannerIndex + ")");

    li.attr("class", "ad-" + adList[index].id);

    // a tag
    var a = jQuery("#ads li:nth-child(" + bannerIndex + ") a");
    a.attr("href", adList[index].link);
    a.attr("title", adList[index].title);

    // img tag
    var img = jQuery("#ads li:nth-child(" + bannerIndex + ") img");
    img.attr("src", adList[index].url);
    img.attr("alt", adList[index].title);

    if (bannerIndex < 3) {
        bannerIndex++;
    } else {
        bannerIndex = 1;
    }
}


