function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function newWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
var galleryArray = [];
var resetzeBox = function(){galleryArray = []};
var add2box = function(myFlowItem){galleryArray.push(myFlowItem);};
var openzeBox = function(id){Shadowbox.open(galleryArray, ShadowboxOptions, id);};

// You can tune your Shadowbox options below (See the exhaustive list of options on http://www.mjijackson.com/shadowbox/doc/api.html)
var ShadowboxOptions = {
      
}

 function openShadowbox(type, title, id){
	 var el = document.getElementById(id);
	Shadowbox.init({skipSetup: true});
	thisgallery = id.toString();
	Shadowbox.open({
            content: $(el)[0],
            gallery: thisgallery,
            player: 'img'
        }); 
};

var page_id;
function initAccordionMenu(menu_id, delay) {
	var easeMethod = 'easeOutQuad';
	var slideSpeed = 'slow';
	$(menu_id+" ul").each(function(index, domEle) {
		if($(this).attr("class") != "nohide"){
			$(this).hide();
		}else{
			 $(this).oneTime(delay, function() {
				$(this).siblings().addClass('active');
				$(this).slideDown(slideSpeed, easeMethod);
			});
		}
	});
	$(menu_id+" li").each(function(index, domEle) {
		
		if($(this).find("a").attr("id") == page_id){
			 $(this).oneTime(delay, function() {
				$(this).find("ul").slideDown(slideSpeed, easeMethod);
			});
			$(this.children).addClass('active');
		}
	});
		$(menu_id+" li a").click(
		function() {
			if($(this).attr("href") == "#" || $(this).attr("id") == page_id){
				var checkElement = $(this).next();
				if((checkElement.is('ul')) && (checkElement.is(':visible'))) {
					if($(this).attr("class") != "nohide"){
							$(checkElement).slideUp(slideSpeed, easeMethod);
							$(checkElement).siblings().removeClass("active");
						}
						
					return false;
				 }
				if((checkElement.is('ul')) && (!checkElement.is(':visible'))) {
					$(menu_id+" ul").each(function(index, domEle) {
						if($(this).attr("class") != "nohide"){
							$(this).slideDown(slideSpeed, easeMethod);
							$(this).prev().removeClass("active");
						}												
					});
					checkElement.slideDown(slideSpeed, easeMethod);
					$(this).addClass('active');
					return false;
				 }
			 }
		 });
	
 }