// JavaScript Document

$(document).ready(function() {
    $('.mainTop').cycle({
		fx: 'fade', // choose your transition type, ex: fade, scrollUp, shuffle, etc...
		speed:  'slow',
		//pause:  1,
		timeout:  7000
	});
});

//$(document).ready(function() {
//
//	$('.shuffle').randomImage({path: 'images/'});
//	$('a:first').click(function() {
//		location.reload();
//		return false;
//	});
//
//});
function initMenus() {
//$('ul.menu ul').hide();
$.each($('ul.menu'), function(){
var cookie = $.cookie(this.id);
if(cookie === null || String(cookie).length < 1) {
$('#' + this.id + '.expandfirst').show();
}
//else {
//$('#' + this.id + ' .' + cookie).next().show();
//}
});
//$('ul.menu li a').click(
//function() {
//var checkElement = $(this).next();
//var parent = this.parentNode.parentNode.id;
//if($('#' + parent).hasClass('noaccordion')) {
//if((String(parent).length > 0) && (String(this.className).length > 0)) {
//if($(this).next().is(':visible')) {
//$.cookie(parent, null);
//}
//else {
//$.cookie(parent, this.className);
//}
//$(this).next().slideToggle('normal');
//}
//}
//if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
//if($('#' + parent).hasClass('collapsible')) {
//$('#' + parent + ' ul:visible').slideUp('normal');
//}
//return false;
//}
//if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
//$('#' + parent + ' ul:visible').slideUp('normal');
//if((String(parent).length > 0) && (String(this.className).length > 0)) {
//$.cookie(parent, this.className);
//}
//checkElement.slideDown('normal');
//return false;
//}
//}
//);
}
$(document).ready(function() {initMenus();});


//$(document).ready(function () {
//$('#nav > li > a').click(function(){
//if ($(this).attr('class') != 'active'){
//$('#nav li ul').slideUp();
//$(this).next().slideToggle();
//$('#nav li a').removeClass('active');
//$(this).addClass('active');
//}
//});
//$('#nav li:first ul').show();
//$('#nav li:first a').addClass('active');
//});

//$(document).ready(function () {	
//  $('#nav > li > a').click(function(){
//      $('#nav li ul').slideUp();
//	   if ($(this).next().is(":visible")){
//		   $(this).next().slideUp();
//	   } else {
//	   $(this).next().slideToggle();
//	   }
//	   $('#nav li a').removeClass('active');
//	   $(this).addClass('active');
//  });
//});

