// Javascript Provided by CRI-CG
// 3/7/2010 - 3/19/2010

$(document).ready(function() {
    
    //$("#thumbnails").yoxview([options]);

    $("img[name='contributors']").click(function(){
         if($(this).attr("src") == "_images/events/contributors_4.gif"){
             $(this).attr("src","_images/events/contributors_4_close.gif");
             $("#listHolder").slideDown(600);

         }
         else{
             $("#listHolder").slideUp(300);
             $(this).attr("src","_images/events/contributors_4.gif");
         }

         });

/*
         $("#saItems").click(function(){             
             $("#eventsa").slideToggle(600, function(){
             try{
                  
                      //if($("#vq").css("display") == "block"){
                          if($("#vq").css("margin-top") == "2657px"){
                              $("#jh").css("margin-top","2106px");
                              $("#bs").css("margin-top","2350px");
                              $("#pd1").css("margin-top","4091px");
                              $("#pd2").css("margin-top","4113px");
                              $("#vq1").css("margin-top","4122px"); 
                              $("#vq2").css("margin-top","4130px"); 
                              
                              //alert('A');
                          }
                          else{
                              $("#jh").css("margin-top","638px");
                              $("#bs").css("margin-top","884px");
                              $("#pd1").css("margin-top","2622px");
                              $("#pd2").css("margin-top","2642px");
                              $("#vq1").css("margin-top","2657px"); 
                              $("#vq2").css("margin-top","2665px"); 
                              //alert('B');
                          }
                     // }    
                 }
                 catch(e){
                 }
             
             });
            return false;

         });

        $("#laItems").click(function(){
            //$("#eventla").slideToggle(800);
            $("#eventla").slideToggle(800, function(){
                $("#eventbottom2").slideToggle(200);
            });

          try{
                  
                  //if($("#vq").css("display") == "block"){

                       if($("#eventsa").css("display") == "none"){
                           $("#jh").css("margin-top","638px");
                           $("#bs").css("margin-top","884px");
                           $("#pd1").css("margin-top","2622px");
                           $("#pd2").css("margin-top","2642px");
                           $("#vq1").css("margin-top","2657px"); 
                           $("#vq2").css("margin-top","2665px"); 
                           
                           //alert($("#vq").css("margin-top")); 
                       }
                       else{
                            $("#jh").css("margin-top","2106px");
                            $("#bs").css("margin-top","2350px");
                            $("#pd1").css("margin-top","4091px");
                            $("#pd2").css("margin-top","4113px");
                            $("#vq1").css("margin-top","4122px"); 
                            $("#vq2").css("margin-top","4130px");                       
                      }
                      //HideImages();
                 //}
            }
            catch(e){

            }

            return false;
         });


    $("#cleva").mouseover(function(){ 
        $("#clev").show();
    });    
    $("#cleva").mouseout(function(){ 
        $("#clev").hide();
    });

   $("#sbxla").mouseover(function(){ 
        $("#sbxl").show();
    });    
    $("#sbxla").mouseout(function(){ 
        $("#sbxl").hide();
    });

    $("#kja1").mouseover(function(){ 
        $("#kjTop").show();
    });    
    $("#kja1").mouseout(function(){ 
        $("#kjTop").hide();
    });

    $("#kja2").mouseover(function(){ 
        $("#kjBot").show();
    });    
    $("#kja2").mouseout(function(){ 
        $("#kjBot").hide();
    });

    $("#kja3").mouseover(function(){ 
        $("#kjBot").show();
    });    
    $("#kja3").mouseout(function(){ 
        $("#kjBot").hide();
    });


    $("#jha").mouseover(function(){ 
        $("#jh").show();
    });    
    $("#jha").mouseout(function(){ 
        $("#jh").hide();
    });

    $("#bsa").mouseover(function(){ 
        $("#bs").show();
    });    
    $("#bsa").mouseout(function(){ 
        $("#bs").hide();
    });

    $("#vqa").mouseover(function(){ 
        $("#vq1").show();
        $("#vq2").show();
    });    
    $("#vqa").mouseout(function(){ 
        $("#vq1").hide();
        $("#vq2").hide();
    });

    $("#pda").mouseover(function(){ 
        $("#pd1").show();
        $("#pd2").show();
    });    
    $("#pda").mouseout(function(){ 
        $("#pd1").hide();
        $("#pd2").hide();
    });

*/
    //picture shuffle
    $("#shuffleContainer").cycle({
        fx: 'shuffle',
        timeout: 5000,
        delay: -4000
    });

    $('#pauseBtn').click(function() { 
        $('#shuffleContainer').cycle('pause'); 
    });

    $('#playBtn').click(function() { 
        $('#shuffleContainer').cycle('resume'); 
    });
 
    $('#pauseBtn').click();
});

function HideImages(){
    $("#clev").hide();
    $("#sbxl").hide();
    $("#kjTop").hide();
    $("#kjBot").hide();
    $("#jh").hide();
    $("#bs").hide();
    $("#vq1").hide();
    $("#vq2").hide();
    $("#pd1").hide();
    $("#pd2").hide();
}

function SwitchImage(tagName, imageName){
    document.images[tagName].src= "_images/events/" + imageName + ".gif";
    return true;
}



/*
function OnAction() {

    if (document.pressed == 'contributors') {
        alert('found');
    }

}



*/
/*
$("#gfsA").mouseout(function(){
     $("#gfs").hide();
});

$("#gfsA").click(function(){
    $("#gfs").hide();
});
*/
function ShowHide(e) {
    var img = document.getElementById(e)  		
    if (img.style.display == "block") {
        img.style.display = "none";
    } else {
        img.style.display = "block";
    }
}
function Hide(e){
    var img = document.getElementById(e)
    img.style.display = "none";
}
function SwitchImage(tagName, imageName){
    document.images[tagName].src= "_images/events/" + imageName + ".png";
    return true;
}
function SwitchImage2(imageName, showLayer) {
    var e = document.getElementById(showLayer);
    e.style.backgroundImage = "url(_images/events/" + imageName + ".gif)";

}


