jQuery(document).ready(function(){
			
	// TOGGLE FUNCTION
	toggleMenu();
	
	// TAB PANEL
	tabPanel();
	
	jQuery("a.bookmark").click(function(){
		var bookmarkUrl = this.href;
		var bookmarkTitle = this.title;
		  
		if (jQuery.browser.mozilla) // For Mozilla Firefox Bookmark
		{ 
			window.sidebar.addPanel(bookmarkTitle, bookmarkUrl,"");
		} 
		else if(jQuery.browser.msie || jQuery.browser.webkit) // For IE Favorite
		{ 
			window.external.AddFavorite( bookmarkUrl, bookmarkTitle); 
		}
		else if(jQuery.browser.opera ) // For Opera Browsers
		{ 
			$("a.bookmark").attr("href",bookmarkUrl);
			$("a.bookmark").attr("title",bookmarkTitle);
			$("a.bookmark").attr("rel","sidebar");
			$("a.bookmark").click();
		} 
		else // for other browsers which does not support
		{ 
			alert('Please hold CTRL+D and click the link to bookmark it in your browser.');
		}
		return false; 
	});
		
});



// TAB PANEL
function tabPanel(){
	
	//Default Action
	jQuery(".tabcontent").hide(); //Hide all content
	jQuery("#tabnav li:first").addClass("active").fadeIn('fast'); //Activate first tab
	jQuery(".tabcontent:first").show(); //Show first tab content
	jQuery("#tabnav li.active:first").css("padding-left","0");
	jQuery("#tabnav li:last").css("background","none");
	
	//On Click Event
	jQuery("#tabnav li").click(function() {
		jQuery("#tabnav li").removeClass("active"); //Remove any "active" class
		jQuery(this).addClass("active"); //Add "active" class to selected tab
		jQuery(".tabcontent").hide(); //Hide all content
		var activeTab = jQuery(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		jQuery(activeTab).stop().fadeIn('fast'); //Fade in the active content
		return false;
	});
	
}
	
// TOGGLE
function toggleMenu(){
	
	jQuery(".toggle_container").hide(); 
	
	//Switch the "Open" and "Close" state per click then slide up/down (depending on open/close state)
	jQuery("p.trigger").click(function(){
		jQuery(this).toggleClass("active").next().slideToggle("slow");
		return false; //Prevent the browser jump to the link anchor
	});
						
}



