jQuery(function() {
  jQuery(this).bind("contextmenu", function(e) {
    e.preventDefault();
  });
}); 

jQuery.noConflict();

jQuery(function(){	
  for(var i = 1; i<=31; i++){
    if(document.getElementById('pane'+i)){
      jQuery('#pane'+i).jScrollPane({showArrows:true});
    }            
  }                       
});

function changeImage(url, id, imageID){
  
  if(url == "/assets/" || url == '' || !url){
    url = "/themes/default/images/LastNews.gif";
    /*if(imageID == 0)
      url = "/themes/default/images/LastNews1.jpg";
    else if(imageID == 1)
      url = "/themes/default/images/LastNews2.jpg";
    else if(imageID == 2)
      url = "/themes/default/images/LastNews3.jpg";
    else
      url = "/themes/default/images/LastNews4.jpg";*/
  }
  document.getElementById("changeimage").src = url;
  jQuery("span.active").removeClass("active");
  jQuery("#newsImage" + id).addClass("active");
  //$("#newsImage" + id).addClass("active");
}
/*
function last_news(){
  var flashvars = {};
         flashvars.newspath = '/api/v1/NewsItem/';
 var params = {};
 params.bgcolor = '#5bbdf0';
 var attributes = {};
 swfobject.embedSWF("/assets/Flash/ticker02.swf", "newsticker", "730", "25", "8.0.0", false, flashvars, params, attributes);
}
*/

function SupportedLogos_initCallback(carousel){
  carousel.clip.hover(function() {
    carousel.stopAutoHover();
  }, function() {
    carousel.startAuto();
  });
};

function FeaturedNews_initCallback(carousel){
  carousel.clip.hover(function() {
    carousel.stopAutoHover();
  }, function() {
    carousel.startAuto();
  });
};

jQuery(document).ready(function() {
  /*jQuery('#FeaturedNews').jcarousel({
    auto: 10,
    wrap: 'circular',
    initCallback: mycarousel_initCallback
  });*/
  
  /*jQuery('#FooterLogos').jcarousel({
    auto: 7,
    wrap: 'circular',
    initCallback: mycarousel_initCallback
  });*/
  
  /*jQuery('#FooterLogos').ULAScroll({
    auto: 5,
    id: 'FooterLogos',
    scrollTime: 500
  });*/
  
  jQuery('#FeaturedNews').ULAScroll({
    auto: 5,
    id: 'FeaturedNews',
    scrollTime: 500,
    initCallback: FeaturedNews_initCallback
  });
  
  jQuery('#SupportedLogos').ULAScroll({
    auto: 0,
    id: 'SupportedLogos',
    scrollTime: 7000,
    lineType: 'linear',
    initCallback: SupportedLogos_initCallback
  });
  
  //jQuery("ul#SupportedLogos").liScroll();
});

function loadAjax(loadIntoElID, page) {
 var completeURL = jQuery('base').attr('href') + page; //NOTE THAT jQuery('base').attr('href') should work as the base tag should be included in your header.
 var imgHtml = '<img src="mysite/javascript/loading.gif" alt="loading . . ." />';
 jQuery("#" + loadIntoElID).html(imgHtml);
 jQuery("#" + loadIntoElID).load(URL, {}, function() {/* another function here that runs after content has been loaded */});
 return true;
}



