function addLoadEvent(func) {
  var oldonload = window.onload;
  
  if (typeof window.onload != 'function') {
    window.onload = func;
  } 
  else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}

addLoadEvent(niftyCorners);


function niftyCorners() {
	if(typeof(Nifty)=='function') {
		Nifty("div.roundedtop", "transparent top");
		Nifty("div.roundedbottom", "transparent bottom");
		Nifty("div.rounded", "transparent");
		Nifty("div.roundedleft", "transparent left");
		Nifty("div.roundedright", "transparent right");
		
		Nifty("div#top_action", "transparent");
	}
}


function sendToList(url, value) {
	if(value != 'none') {
	window.location = url + "/" + value + "/";
	}
}

if(typeof(jQuery)=='function') {
	jQuery(document).ready(function() {
		jQuery('#latest-reviews-block ul.carousel').each(function() {
			jQuery(this).cycle({ 
				fx:      'fade', 
				speed:   1000, 
				timeout: 10000,
				pager:  '#latest-reviews-block .nav',
				pagerAnchorBuilder: function(index, slide) { 
					return '#latest-reviews-block .nav ul li:eq(' + index + ') a'; 
				} 
			});										   
		});
		
		jQuery("#latest-features div.carousel").each(function() {
			jQuery(this).jCarouselLite({
				btnPrev: ".show-previous",
				btnNext: ".show-next",
				speed: 1000,
				visible:3,
				easing: "bounceout"
			});
		});
		
		jQuery("#latest-reviews div.carousel").each(function() {
			jQuery(this).jCarouselLite({
				btnPrev: ".show-previous",
				btnNext: ".show-next",
				speed: 500,
				visible:5,
				easing: "bounceout"
			});
		});
			
		jQuery('a.media').each(function() {
			jQuery(this).media();
		});
	});

}

