jQuery(InitSite);
var stoptimer=0;

function InitSite()
{
    $('.bigpicture').bigPicture();
    
    if($("#whatsnewslider").size())
    {
        $('#whatsnewslider').css("width",($('#sliderchanger div').size()*660)+"px");
        $('#sliderchanger :first').addClass("enabled");
        $('#sliderchanger div').bind("click",
            function(e)
            {
                stoptimer=1;
                Scroll(e.target.id.substring(7));
            }
        );
        
        $.timer(5000,
            function(timer)
            {
                if(stoptimer)
                    timer.stop();
                else
                {
                    var current=parseInt($('#sliderchanger .enabled').attr("id").substring(7));
                    if(current!=($('#sliderchanger div').size()-1))
                        Scroll(current+1);
                    else
                        Scroll(0);
                }
            }
        );
    }
}

function Scroll(number)
{
    $('#sliderchanger div').removeClass("enabled");
    $('#whatsnewslider_container').scrollTo((number*660),{axis: 'x', duration: 250});    
    $('#section'+number).addClass("enabled");    
}


$(document).ready(function() 
{
   // By suppling no content attribute, the library uses each elements title attribute by default
   $('#page_content_left a[href][title].tiptool').qtip({
      content: {
         text: false // Use each elements title attribute
      },
	  style: { 
      	 	 border: {
	         width: 2,
	         radius: 8
      		},
      width: 400,
	  name: 'cream',
	  tip:'topMiddle'
	  
},	  
position: {
	      corner: {
	         target: 'bottomMiddle',
	         tooltip: 'topMiddle'
	      }
   		}
   });
   
   // NOTE: You can even omit all options and simply replace the regular title tooltips like so:
   // $('#content a[href]').qtip();
});



/*function ShowDialog()
{
    Effect.Appear("overlay",{from: 0, to: 0.7, duration: 0.5, afterFinish: 
    function()
    {
       Effect.Appear("dialog",{from:0, to:1, duration: 0.5});
    }});
}

function HideDialog()
{
   Effect.Fade("dialog",{from: 1, to: 0, duration: 0.5, afterFinish:
   function()
   {
      Effect.Appear("overlay", {from: 0.7, to: 0, duration: 0.5, afterFinish: 
      function()
      {
           $('overlay').style.display="none";
      }});
   }});

}

*/