
function mycarousel_initCallback(carousel)
{
    // Disable autoscrolling if the user clicks the prev or next button.
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });

    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });

    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};

function AddToFavorites()  
{  
    var title = document.title; var url = location.href;  
    if (window.sidebar) // Firefox  
        window.sidebar.addPanel(title, url, '');  
    else if(window.opera && window.print) // Opera  
    {  
        var elem = document.createElement('a');  
        elem.setAttribute('href',url);  
        elem.setAttribute('title',title);  
        elem.setAttribute('rel','sidebar'); // required to work in opera 7+  
        elem.click();  
    }   
    else if(document.all) // IE  
        window.external.AddFavorite(url, title);  
}


	function addMega(){
		var t = $(this).attr('rel');
		$(".servicesdropped:not(.servicesdropped"+t+")").hide();
		$(".servicesdropped"+t).slideToggle("fast");
      }

      function removeMega(){
        var t = $(this).attr('rel');
		$(".servicesdropped:not(.servicesdropped"+t+")").hide();
		$(".servicesdropped"+t).slideToggle("fast");

      }	
jQuery.extend(jQuery.easing,{def:'easeOutQuad',swing:function(a,b,c,d,e){return jQuery.easing[jQuery.easing.def](a,b,c,d,e)}});
$(document).ready(function(){


 
$(".oddEven tr:nth-child(even)").addClass("odd");

	
	
	    var megaConfig = {
         interval: 50,
         sensitivity: 4,
         over: addMega,
         timeout: 50,
         out: removeMega
    };

$('.servicesdropped').append('<div class="servicesdroppedShadow"></div>');
    $(".downservices").hoverIntent(megaConfig);
	
	 $('#topBanner #sliders').cycle({
		pager:  '#cycleNav',
		fx: 'fade',
		timeout: 6000,
		speed:2000,
		pagerAnchorBuilder: function(idx, slide) { 
		var idx = idx*1;
		idx = idx+1;
        return '<span><a href="#">'+idx+'</a></span>'; 
    } 
	});
	 
	 
// stop cycle when hovering	 
	$('#topBanner #sliders').hover(function() {
		$('#topBanner #sliders').cycle('pause');
	}, function() {
		$('#topBanner #sliders').cycle('resume');
	});


$(".validateForm").validate();

 $("ul.dropdown li").hover(function(){
   $(this).addClass("hover");
   $('> .dir',this).addClass("open");
   $('ul:first',this).css('visibility', 'visible');
 },function(){
   $(this).removeClass("hover");
   $('.open',this).removeClass("open");
   $('ul:first',this).css('visibility', 'hidden');
 });


if(($.browser.msie == true && $.browser.version !== '6.0') || ($.browser.msie !== true)){
	// rotating partners
	$('.partners').jcarousel({
		wrap: "last",
		scroll:1,
		auto: 4,
		initCallback: mycarousel_initCallback
	});
}

$('#carousel').css('overflow-y','hidden');$('.socialBar_hideToggle').click(function(){$('#socialBarWrapper').animate({height:'0px'},'fast',function(){$('.socialBar_showToggleWrapper').animate({height:'30px'},'fast')})}); $('.titleRSSfeed a').click(function(){ pageTracker._trackPageview('/tracking/news_rss'); }); $('.socialBar_showToggle').click(function(){$('.socialBar_showToggleWrapper').animate({height:'0px'},'fast',function(){$('#socialBarWrapper').animate({height:'30px'},'fast')})});$('.lightbox').lightBox();$('ul.categoryitems>li>a').click(function(){$.cookie("expandableMenu",'yes',{path:'/'})});$('.arrowlistmenu>ul>li>a').click(function(){$.cookie("expandableMenu",'no',{path:'/'})});$('#topNav>.topNavOption>a').click(function(){$.cookie("expandableMenu",'no',{path:'/'})});$('#footer>.footerOption>a').click(function(){$.cookie("expandableMenu",'no',{path:'/'})})});ddaccordion.init({headerclass:"expandable",contentclass:"categoryitems",revealtype:"click",collapseprev:true,defaultexpanded:[],animatedefault:false,persiststate:true,toggleclass:["","openheader"],togglehtml:["prefix","",""],animatespeed:"normal",oninit:function(a,b){},onopenclose:function(a,b,c,d){}})



$(".validate").validate();	

//DD_roundies.addRule('.corner5', '5px 5px 5px 5px');
//DD_roundies.addRule('.corner10', '10px 10px 10px 10px');
//DD_roundies.addRule('.cornerBottom', '0px 0px 5px 5px');
//DD_roundies.addRule('.cornerTop', '5px 5px 0px 0px');





