$(document).ready(function() {

	/* MEGA MENU */
	function addMega(){ 
		$($(this).find("li.mega h2")).addClass("hover");	
		$($(this).find("div.mega-choices")).slideDown("fast");	
		$(this).addClass("hovering");
	}
	
	function removeMega(){
		$($(this).find("li.mega h2")).removeClass("hover");	
		$($(this).find("div.mega-choices")).slideUp("fast");
		$(this).removeClass("hovering");
	}
	
	var megaConfig = { interval: 100, sensitivity: 20, over: addMega, timeout: 100, out: removeMega }
	
	$("li.mega").hoverIntent(megaConfig);
	
	/* MEGA-ADMIN MENU */
	function addMegaAdmin(){ 
		$($(this).find("li.mega-admin h2")).addClass("hover");	
		$($(this).find("div.mega-choices")).slideDown("fast");	
		$(this).addClass("hovering");
	}
	
	function removeMegaAdmin(){
		$($(this).find("li.mega-admin h2")).removeClass("hover");	
		$($(this).find("div.mega-choices")).slideUp("fast");
		$(this).removeClass("hovering");
	}
	
	var megaConfigAdmin = { interval: 100, sensitivity: 20, over: addMegaAdmin, timeout: 100, out: removeMegaAdmin
	}
	
	$("li.mega-admin").hoverIntent(megaConfigAdmin);
	
	/* END MEGA ADMIN */

	/* SHOP CATEGORIES MENU */
	function addShopCategories(){ 
		$($(this).find("li.mega-shopcategories h2")).addClass("hover");	
		$($(this).find("div.mega-choices")).slideDown("fast");	
		$(this).addClass("hovering");
	}
	
	function removeShopCategories(){
		$($(this).find("li.mega-shopcategories h2")).removeClass("hover");	
		$($(this).find("div.mega-choices")).slideUp("fast");
		$(this).removeClass("hovering");
	}
	
	var megaConfigShopCategories = { interval: 100, sensitivity: 20, over: addShopCategories, timeout: 100, out: removeShopCategories
	}
	
	$("li.mega-shopcategories").hoverIntent(megaConfigShopCategories);
	
	/* END MEGA ADMIN */

});

$(document).ready(function() {
	
	$('a.basic').cluetip();
	
	$('a.jt').cluetip({
		cluetipClass: 'jtip', 
		width: '320px', 
		arrows: true, 
		dropShadow: true, 
		hoverIntent: false
	});
	
});
	

$(document).ready(function() {
	$('li#contact').localScroll();
});

$(document).ready(function() {
	$("#current_rev").html("v"+$.mcDropdown.version);
	$("#category").mcDropdown("#categorymenu");
});

$(document).ready(function(){
	$("div#loggedin-nav").hide();
	$("div#loggedin-button").click(function () {
		$("div#loggedin-nav").slideToggle("slow");
	});
});

$(document).ready(function(){    
        //toggle .soundbytedetail div
        
	$(".soundbytelink").toggle(

	function (){
		$(this).siblings(".soundbytedetail").show("fast");
	}, 

	function (){
		$(this).siblings(".soundbytedetail").hide("fast");
	});
 
});

function OnlineRegTOP(){
  window.open('https://www4.e-council.net/code/onlinereg?council=607','remote','top=10,left=10,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

function OnlineRegPE(){
  var register = window.open('https://www4.e-council.net/code/onlinereg?council=607&Jumpto=Step2&Type=PE','remote','top=10,left=10,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

function OnlineRegAT(){
  window.open('https://www4.e-council.net/code/onlinereg?council=607&Jumpto=Step2&Type=AT','remote','top=10,left=10,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

function OnlineRegOG(){
  window.open('https://www4.e-council.net/code/onlinereg?council=607&Jumpto=Step2&Type=OG','remote','top=10,left=10,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

function OnlineRegCM(){
  window.open('https://www4.e-council.net/code/onlinereg?council=607&Jumpto=Step2&Type=CM','remote','top=10,left=10,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

function OnlineRegDirect(Eventid){
  var register = window.open('https://www4.e-council.net/code/onlinereg?council=607&Jumpto=Step2&Type=PE','remote','top=10,left=10,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
	
	if (window.focus) {newwindow.focus()}

	onlineRegGoToEvent(Eventid);
	//setTimeout("onlineRegGoToEvent("+Eventid+")",1000);// 1 seconds
}

function OnlineRegDirect2(Eventstring){
  var register = window.open('https://www4.e-council.net/code/onlinereg?council=607&JumpTo=Step3&'+Eventstring,'remote1','top=30,left=30,width=860,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
	
	if (window.focus) {newwindow.focus()}
	
	//onlineRegGoToEvent2(Eventid);
	//setTimeout("onlineRegGoToEvent2("+Eventid+")",1000);// 1 seconds
}

function onlineRegGoToEvent(Eventid){
	var reloadPage = window.open('https://www4.e-council.net/code/admin/onlinereg/index.cfm?fuseaction=Registration&Eventid='+Eventid+'','remote1','top=30,left=30,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

function onlineRegGoToEvent2(Eventid){
	var reloadPage = window.open('https://www4.e-council.net/code/onlinereg?council=607&JumpTo=Step3&Eventid='+Eventid+'&type=CM','remote1','top=30,left=30,width=770,height=550, scrollbars=yes,resizable=yes,status=yes,menubar=no');
}

