
var csstype="inline" //Specify type of CSS to use. "Inline" or "external"

var mac_css='.mainmenu li{ letter-spacing: 0px; }' //if "inline", specify mac css here
var pc_css='.mainmenu li{ letter-spacing: 1px; }' //if "inline", specify PC/default css here

///////No need to edit beyond here////////////

var mactest=navigator.userAgent.indexOf("Mac")!=-1
if (csstype=="inline"){
document.write('<style type="text/css">')
if (mactest)
document.write(mac_css)
else
document.write(pc_css)
document.write('</style>')
}




function openPrintContent(url)
   {
	var width=764;
	var height=560;
	window.open ('/include/printable_content.php?id='+url,"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbars=1,status=0");	
	}

function openPrintContent2(url)
   {
	var width=764;
	var height=560;
	window.open ('/include/printable_content2.php?id='+url,"_blank","top=200,left=200,width="+width+",height="+height+",menubar=0,scrollbars=1,status=0");	
	}
	


function reloadCode(){
	
	var oimg=document.getElementById('imgsecurity');
	var url=oimg.src;
	oimg.src=url+"?a=" + new Date();
	
	
}


	


function slideSwitch() {
    var $active = $('#newstext li.active');

    if ( $active.length == 0 ) $active = $('#newstext li:last');

    // use this to pull the divs in the order they appear in the markup
    var $next =  $active.next().length ? $active.next()
        : $('#newstext li:first');

    $active.addClass('last-active');

    $next.css({opacity: 0.0})
        .addClass('active')
        .animate({opacity: 1.0}, 1000, function() {
            $active.removeClass('active last-active');
        });
}

$(function() {
    setInterval( "slideSwitch()", 5000 );
});

<!-- end simple slide switch -->

<!-- carousel -->

function mycarousel_initCallback(carousel)
{
    // Pause autoscrolling if the user moves with the cursor over the clip.
    carousel.clip.hover(function() {
        carousel.stopAuto();
    }, function() {
        carousel.startAuto();
    });

};


/*jQuery(document).ready(function() {
    
});

*/


$("#carouselimg0").ready(function (){
        
        jQuery('#mycarousel').jcarousel({
		scroll: 1,
        auto: 4,
        wrap: 'circular',
		animation: 'slow',
		initCallback: mycarousel_initCallback
    });

    });

<!-- end carousel -->




$(document).ready(function(){


/* megamenu */
function megaHoverOver(){
//Find sub and fade it in	
	$(this).find(".sub").stop().fadeTo('fast', 1, function() {
	$(this).show();
	$(".menudiv").stop().fadeTo('fast', 0.5).show();
    });
	
	(function($) {
        //Function to calculate total width of all ul's
        jQuery.fn.calcSubWidth = function() {
            rowWidth = 0;
            //Calculate row
            $(this).find("ul").each(function() { //for each ul...
                rowWidth += $(this).width(); //Add each ul's width together
            });
        };
    })(jQuery); 

    if ( $(this).find(".row").length > 0 ) { //If row exists...

        var biggestRow = 0;	

        $(this).find(".row").each(function() {	//for each row...
            $(this).calcSubWidth(); //Call function to calculate width of all ul's
            //Find biggest row
            if(rowWidth > biggestRow) {
                biggestRow = rowWidth;
            }
        });

        $(this).find(".sub").css({'width' :biggestRow}); //Set width
        $(this).find(".row:last").css({'margin':'0'});  //Kill last row's margin
    } else { //If row does not exist...
        $(this).calcSubWidth();  //Call function to calculate width of all ul's
        $(this).find(".sub").css({'width' : rowWidth}); //Set Width

    }
}
//On Hover Out
function megaHoverOut(){
  $(this).find(".sub").stop().fadeTo('fast', 0, function() { //Fade to 0 opactiy
      $(this).hide();  //after fading, hide it
  });
}

$(".mainmenutop2").mouseenter(function() {
  $(".menudiv").stop().fadeTo('fast', 0.5).show();
});

$(".mainmenutop2").mouseleave(function() {
  $(".menudiv").stop().fadeTo('fast', 0, function() {
  $(".menudiv").hide();
  });
});


var config = {
     sensitivity: 2, // number = sensitivity threshold (must be 1 or higher)
     interval: 100, // number = milliseconds for onMouseOver polling interval
     over: megaHoverOver, // function = onMouseOver callback (REQUIRED)
     timeout: 500, // number = milliseconds delay before onMouseOut
     out: megaHoverOut // function = onMouseOut callback (REQUIRED)
};

$("ul#topnav li .sub").css({'opacity':'0'}); //Fade sub nav to 0 opacity on default
$("ul#topnav li").hoverIntent(config); //Trigger Hover intent with custom configurations

});

