﻿

var flashVars = {thumbs:"1"};
var params = {};
//params.thumbs = 1;
//flashvars.thumbs = 1;
params.menu = "false";
params.quality = "best";
params.wmode = "transparent";
var attributes = {};
var x = "test";
var temp = 1;
var thumbsCount;

$(document).ready(function() {

    
    //$(function() { $(".lavaLamp").lavaLamp({ fx: "backout", speed: 700 }) });
  
});

function playVideo(video,thumbnum) {

    $("#thumbs" + thumbnum).hide("drop", { direction: 'up' }, 500);
    $("#thumbsnav").hide("drop", { direction: 'down' }, 500);
    $("#closevideobutton" + thumbnum).show();
    $("#closevideobutton" + thumbnum).css("left", screen.width / 2 + 250 + "px");

    $("#videoplayershell").css("left", screen.width/2 -240  + "px");

    flashVars = { thumbs: thumbnum };
    //alert(thumbnum);
    //alert(video);
    swfobject.embedSWF(video, "videoplayer", "480", "360", "9.0.0", false, flashVars, params, attributes);
}

function playVideoIndex(video, thumbnum) {

    //$("#thumbs" + thumbnum).hide("drop", { direction: 'up' }, 500);
    $("#content").hide("drop", { direction: 'down' }, 250);
    
    $("#closevideobutton").show();
    $("#closevideobutton").css("left", screen.width / 2 + 250 + "px");
    $("#videoplayershell").show();
    $("#videoplayershell").css("left", screen.width / 2 - 240 + "px");

    flashVars = { thumbs: thumbnum };
    //alert(thumbnum);
    //alert(video);
    swfobject.embedSWF(video, "videoplayer", "480", "360", "9.0.0", false, flashVars, params, attributes);
}


function closeVideo(x) {
    $("#closevideobutton" + x).hide("drop", { direction: 'right' }, "easeOutElastic");
    $("#videoplayershell").html("<div id='videoplayer'></div>");
    $("#thumbsnav").show("drop", { direction: 'down' }, 250 );
    $("#videoplayershell").css("left", "-500px");
    $("#thumbs" + x).show("drop", { direction: 'up' }, "easeOutElastic");

}

function closeVideoIndex(x) {
    //alert("closeIndex");
    $("#closevideobutton").hide("drop", { direction: 'right' }, "easeOutElastic");
    $("#videoplayershell").html("<div id='videoplayer'></div>");
    //$("#thumbsnav").show("drop", { direction: 'down' }, 250);
    $("#videoplayershell").css("left", "-500px");
    $("#content").show("drop", { direction: 'up' }, "easeOutElastic");

}  

 function showThumbs(action,thumbscount) {

     //alert(thumbscount);
        
    $(".thumbs").hide();
    if (action == 'next') {
        temp=temp+1;
        if (temp > thumbsCount){
            temp=1;
        }
        $("#thumbs" + temp).show();
        $("#thumbs" + temp).show("drop",{direction:'left'},300);

    }

    if (action == 'previous') {
        $(".thumbs").hide();
        temp = temp - 1;
        if (temp == 0) {
            temp = thumbsCount;
        }
        $("#thumbs" + temp).show();
        $("#thumbs" + temp).show("drop",{direction:'right'},300);
    }

}



