// Javascript Document

// BANNER TRANSITIONS
var promoTimer = 5; //seconds
jQuery(document).ready(function () {
    if($("#bannerPromo div.promoSet").length>1) {
        setTimeout('nextPromo()', promoTimer*1000);
    }
});
function nextPromo() {
    $("#bannerPromo div.promoSet:first").next().fadeIn(750, function() {
        $(this).prev().hide().appendTo($("#bannerPromo"));
        setTimeout('nextPromo()', promoTimer*1000);
    });
}

// POPUP WINDOW SETTINGS
function popupWindow(url,description,width,height) {
    var width = width;
    var height = height;
    var url = url;
    swidth = ((screen.availWidth/2)-(width/2));
    sheight = ((screen.availHeight/2)-(height/2));
    newWindow = window.open(url,description,'width='+ width +',height='+ height +',screenY='+ sheight +',screenX='+ swidth +',top=' + sheight + ',left=' + swidth + ',resizeable=no,scrollbars=yes,toolbar=no,status=yes,menubar=no,location=no');
    newWindow.focus();
}

function sendFriendPopup(url) {
    var description = 'send_to_a_friend';
    var width = 500;
    var height = 565;
    swidth = ((screen.availWidth/2)-(width/2));
    sheight = ((screen.availHeight/2)-(height/2));
    newWindow = window.open('/sendtoafriend.php?url='+url,description,'width='+ width +',height='+ height +',screenY='+ sheight +',screenX='+ swidth +',top=' + sheight + ',left=' + swidth + ',resizeable=no,scrollbars=yes,toolbar=no,status=yes,menubar=no,location=no');
    newWindow.focus();
}

function sendPromoToAFriend() {
    var description = 'send_promo_to_a_friend';
    var width = 500;
    var height = 440;
    swidth = ((screen.availWidth/2)-(width/2));
    sheight = ((screen.availHeight/2)-(height/2));
    newWindow = window.open('/send-promo-to-a-friend.php',description,'width='+ width +',height='+ height +',screenY='+ sheight +',screenX='+ swidth +',top=' + sheight + ',left=' + swidth + ',resizeable=no,scrollbars=yes,toolbar=no,status=yes,menubar=no,location=no');
    newWindow.focus();
}