var video1width = "135";
var video1height = "113";

var video2width = "179";
var video2height = "150";

var video3width = "270";
var video3height = "226";

var video4width = "231";
var video4height = "194";

var video5width = "270";
var video5height = "177";


var swfCtr = 0;

function videothumbnail(youtubeurl, thumbnailfilename, size) {

    document.write('<div id="swf' + swfCtr + '" class="videobox" style="width:' + eval('video' + size + 'width') + 'px;"><a href="#" onclick="playVideo(' + swfCtr + ',\'' + youtubeurl + '\',' + size + '); return false;"><img src="/img/video-thumbnails/' + thumbnailfilename + '"/></a></div>');

    swfCtr++;


}


function playVideo(videoNum, url, size) {


    var fo = new SWFObject(url + '&autoplay=1&rel=0&showinfo=0', "movie_player", eval('video' + size + 'width'), eval('video' + size + 'height'), "8", "#FFFFFF");

    fo.addParam("wmode", "transparent");
    player_written = fo.write("swf" + videoNum);


}



function MM_openBrWindow(url) {

    location = url;

}

function sClick(name) {

    //var img = new Image;
    //img.src = '/SponsorClick.aspx?' + name;

}


function GetMetaContent(tagName) {

    var metaTags = document.getElementsByTagName('meta');

    for (var i = 0; i < metaTags.length; i++) {
        if (metaTags[i].name == tagName) {
            return metaTags[i].content;
        }
    }
}
var thedesc = GetMetaContent("description")
var theurl = document.location.href
var thetitle = document.title

function fb() {
    window.open("http://www.facebook.com/sharer.php?u=" + theurl + "&t=" + thetitle);
}

function tw() {
    window.open("http://twitter.com/home?status=" + thetitle + " - " + theurl);
}

function delicious() {
    window.open("http://delicious.com/save?url=" + theurl + "&title=" + thetitle + "&notes=" + thedesc);
}

function digg() {
    window.open("http://digg.com/submit?url=" + theurl + "&title=" + thetitle + "&bodytext=" + thedesc);
}


function openpopup(url) {

    var link = document.getElementById("navigatelink");

    if (link.click) {
        var targetWndName = "MyWindow" + Math.floor(Math.random() * 1000).toString();
        var wnd = window.open("", targetWndName);
        link.target = targetWndName;
        link.href = url;
        link.click();
        wnd.focus();
    }
    else {
        window.open(url);

    }

}


$(document).ready(function() {
    $("div#slideshow").slideView();

	$('#navMain li:last-child').css({'background' : 'pink'});
});

$(window).load(function() {

    $('img.delayload[srcdelay]').attr('src', function() {
        return $(this).attr('srcdelay');
    });
});



