$(function () {
	if($('.whats_new_wrap #mycarousel').length) {
	  jQuery('#mycarousel').jcarousel({
	  	//auto: 5,
		visible: 3,
		wrap: 'last',
		initCallback: mycarousel_initCallback
	  });
	} else {
		if($('#mycarousel').length) {
		  jQuery('#mycarousel').jcarousel({});
		}
	}

	if($('.all_events_list table').length) {
        $('.all_events_list table').find('tr:even').addClass('color');
    }

	if($.browser.msie && $.browser.version == 6) {
		var bodywidth = $('html').width();
		if (bodywidth < 1000) {
			$('#wrapper').css('width', 1000);
			$('#links').css('width', 1000);
		} else if(bodywidth > 1440) {
				$('#wrapper').css('width', 1410);
				$('#links').css('width', 1410);
			}
			else {
				$('#wrapper').css('width', 'auto');
				$('#links').css('width', 'auto');
			}
	}


});
function mycarousel_initCallback(carousel)
{
    carousel.buttonNext.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.buttonPrev.bind('click', function() {
        carousel.startAuto(0);
    });
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });
};
// =fixing png for IE. now you should only add class "png" to show the transparent *.png image in IE6
function PNG(element){
     if (/MSIE (5\.5|6).+Win/.test(navigator.userAgent)){
     var src;
     if (element.tagName=='IMG'){
               if (/\.png$/.test(element.src)){
                    src = element.src;
                    element.src = "/web/themes/default/img/t.gif"; // = 1*1px  transparent image and path for it
               }
          }
          else {
               src = element.currentStyle.backgroundImage.match(/url\("(.+\.png)"\)/i)
               if(src){
                    src = src[1];
                    element.runtimeStyle.backgroundImage="none";
               }
          }
     if (src) element.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + src + "',sizingMethod='noscale')";
     }
}

function showPrintable(url) {
        var winSets = 'left=0,top=0,height=600,width=800,menubar=no,toolbar=no,resizable=yes,status=no,scrollbars=yes';
        var prWin = window.open( url, "winPrint", winSets);
}
