﻿
         function showPic(action) {

            for (var x = 1; x < itemCount+1; x++){
                $("#media" + x).hide();
            }
            if (action == 'next') {
                itemNum=itemNum+1;
                //alert("itemnum:" + itemNum + " | itemcount " + itemCount);
                if (itemNum == itemCount+1){
                    itemNum=1;
                }
               //$("#media" + itemNum).fadeIn("slow");
               $("#media" + itemNum).show("scale");
             
            $("#itemcount").html(itemCount);
            $("#itemnum").html(itemNum);

              
            }
            
            if (action == 'previous') {
                itemNum = itemNum-1;
                 if (itemNum==0){
                    itemNum=itemCount;
                }                   
                $("#media" + itemNum).fadeIn("fast");
            }

        }


        function showPicb(action,medianame,mcount) {
           
            mediacount=mcount;
 
            if (action == 'next') {

            for (var x = 1; x <= mediacount; x++){
              $("#mediab" + x).hide();
              $("#mediabinfo" + x).hide();
            }
            itemNumb = itemNumb + 1;
               if (itemNumb > mediacount) 
                {
                 itemNumb = 1;
                }
            $("#mediab" + itemNumb).slideToggle("slow");
            $("#mediabinfo" + itemNumb).fadeIn("fast");
                        
            }
            
            
            
           if (action == 'previous') {

            for (var x = 1; x <= mediacount; x++){
              $("#mediab" + x).hide();
              $("#mediabinfo" + x).hide();
            }
            itemNumb = itemNumb - 1;
               if (itemNumb ==0) 
                {
                 itemNumb = 1;
                }
            $("#mediab" + itemNumb).slideToggle("slow");
            $("#mediabinfo" + itemNumb).fadeIn("fast");
                        
            }
            
        }
        
       
  
    


   function showItem(mediadir, mediacount, mediatitle, medianame) {

       $("#abc").load("slider/itemViewer3.aspx?filename=" + medianame + ".jpg");
       //$("#abc").load("slider/itemViewer4.aspx?filename=" + medianame + ".jpg&mediadir=" + x); 
 
        
        $("#abc").slideToggle("slow");
        
        $("#bg").show();
        opacity("bg", 0, 85, 1000);

    }

    function closeImage(x) {
        //opacity("fadebg",0,75,1500);
        $("#abc").hide("blind");
        $("#bg").fadeOut("slow");

    }


    function closeMoreInfo(x) {
        //opacity("fadebg",0,75,1500);
        $("#moreinfoshell").hide("blind");
        $("#moreinfoBGPIC").hide("blind");

        $("#bg").fadeOut("slow");
        intInterval = setInterval("showPic(action = 'next')", 4000);


    }




    $(document).ready(function() {
        if (jQuery.browser.safari || jQuery.browser.mozilla || jQuery.browser.opera) {

            if ((screen.width <= 1024)) {
                $("#woody").css("left", screen.width / 2 + 230 + "px");
                $("#moreinfoshell").css("left", screen.width / 2 - 450 + "px");
                $("#btn_close").css("left", screen.width / 2 + 120 + "px");
                $("#links1").css("left", screen.width / 2 - 510 + "px");
                $("#attractionlinks").css("left", screen.width / 2 - 530 + "px");
                $("#abc").css("left", screen.width / 2 - 350 + "px");
                $("#moreinfoshell").css("left", screen.width / 2 - 475 + "px");
                $("#btn_close").css("left", screen.width / 2 + 390 + "px");
                $("#facebook").css("left", screen.width / 2 - 285 + "px");

            }

            if ((screen.width > 1024)) {
                $("#woody").css("left", screen.width / 2 + 210 + "px");
                $("#moreinfoshell").css("left", screen.width / 2 - 450 + "px");
                $("#links1").css("left", screen.width / 2 - 510 + "px");
                $("#attractionlinks").css("left", screen.width / 2 - 550 + "px");
                $("#abc").css("left", screen.width / 2 - 350 + "px");
                $("#moreinfoshell").css("left", screen.width / 2 - 475 + "px");
                //$("#btn_close").css("left", screen.width / 2 + 350 + "px");
               
                $("#facebook").css("left", screen.width / 2 - 285 + "px");

            }


        }

        if (jQuery.browser.msie) {

            if (screen.width <= 1024) {
                $("#attractionlinks").css("left", screen.width / 2 - 540 + "px");
                $("#woody").css("left", screen.width / 2 + 230 + "px");
                $("#abc").css("left", screen.width / 2 - 380 + "px");
                $("#links1").css("left", screen.width / 2 - 510 + "px");
                $("#moreinfoshell").css("left", screen.width / 2 - 450 + "px");
                $("#moreinfoshell").css("right", screen.width / 2 + 450 + "px");
                $("#facebook").css("left", screen.width / 2 - 285 + "px");


            }
            if ((screen.width > 1024)) {
                $("#attractionlinks").css("left", screen.width / 2 - 590 + "px");
                $("#woody").css("left", screen.width / 2 + 190 + "px");
                $("#abc").css("left", screen.width / 2 - 380 + "px");
                $("#links1").css("left", screen.width / 2 - 540 + "px");
                $("#moreinfoshell").css("left", screen.width / 2 - 450 + "px");
                $("#moreinfoshell").css("right", screen.width / 2 + 450 + "px");
                $("#facebook").css("left", screen.width / 2 - 285 + "px");


            }

        }

        //alert(String($("#moreinfoshell").css("right")).substring(0, parseInt(String($("#moreinfoshell").css("right")).length) + 20) + "px");
    });

function setMagnifyingGlass() {
    if (jQuery.browser.safari || jQuery.browser.mozilla || jQuery.browser.opera) {
        $(".magnifyingglass").css("left", screen.width / 2 + 125 + "px");
    }
    if (jQuery.browser.msie) {
        $(".magnifyingglass").css("left", screen.width / 2 + 65 + "px");
    }

    $(".magnifyingglass").css("left", screen.width / 2 + 125 + "px");

}
     



    function showPage(page) {

        $("#moreinfo").load("moreInfoPages/" + page);
        $("#moreinfo").show();
        $("#moreinfoshell").hide();
        $("#moreinfoshell").slideToggle("slow");

        $("#bg").show();
        opacity("bg", 0, 85, 1000);
        clearInterval(intInterval);
    }

     jQuery(document).ready(function() {
         var opts = {};
         jQuery('#menu').jqDock(opts);
         jQuery('#kidcollage').jqDock(opts);
     });
     
    intInterval=setInterval("showPic(action = 'next')",4000);


    function showNextMedia(mediaCount) {
        for (mediaID = 0; mediaID <= mediaCount; mediaID++) {
            $("#fullmedia" + x).hide();
        }
    }

    function showPreviousMedia() {
        for (mediaID = 0; mediaID <= mediaCount; mediaID++) {
            $("#fullmedia" + mediaID).hide();
        }
    }


    function showTwitterFeed() {
       // $("#twitterfeed").load("twitterFeed.htm");
        //$("#twitterfeed").show();


    }

    function hideTwitterFeed() {
        //$("#twitterfeed").load("moreinfopages/twitterfeed.htm");
       // $("#twitterfeed").hide();


    }

    function showEvents() {
        $("#eventsText").attr("src", "images/eventsText2.png");
    }

    function hideEvents() {
        $("#eventsText").attr("src", "images/eventsText.png");
        
    }
