

$(document).ready(function() {

	//Default Action
	$(".tab_content").hide(); //Hide all content
	$("ul.tabs li:first").addClass("active").show(); //Activate first tab
	$(".tab_content:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
$(".tab_content2").hide(); //Hide all content
	$("ul.tabs2 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content2:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs2 li").click(function() {
		$("ul.tabs2 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content2").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	$(".tab_content03").hide(); //Hide all content
	$("ul.tabs03 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content03:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs03 li").click(function() {
		$("ul.tabs03 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content03").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	$(".tab_content-magz1").hide(); //Hide all content
	$("ul.tabs-magz1 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content-magz1:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs-magz1 li").click(function() {
		$("ul.tabs-magz1 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content-magz1").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	
	$(".tab_content-magz2").hide(); //Hide all content
	$("ul.tabs-magz2 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content-magz2:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs-magz2 li").click(function() {
		$("ul.tabs-magz2 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content-magz2").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	$(".tab_content-magz3").hide(); //Hide all content
	$("ul.tabs-magz3 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content-magz3:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs-magz3 li").click(function() {
		$("ul.tabs-magz3 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content-magz3").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	$(".tab_content-magz4").hide(); //Hide all content
	$("ul.tabs-magz4 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content-magz4:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs-magz4 li").click(function() {
		$("ul.tabs-magz4 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content-magz4").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
	$(".tab_content-magz5").hide(); //Hide all content
	$("ul.tabs-magz5 li:first").addClass("active").show(); //Activate first tab
	$(".tab_content-magz5:first").show(); //Show first tab content
	
	//On Click Event
	$("ul.tabs-magz5 li").click(function() {
		$("ul.tabs-magz5 li").removeClass("active"); //Remove any "active" class
		$(this).addClass("active"); //Add "active" class to selected tab
		$(".tab_content-magz5").hide(); //Hide all tab content
		var activeTab = $(this).find("a").attr("href"); //Find the rel attribute value to identify the active tab + content
		$(activeTab).fadeIn(); //Fade in the active content
		return false;
	});
	
});

animatedcollapse.addDiv('Q1', 'fade=1');


animatedcollapse.addDiv('Q2', 'fade=1');


animatedcollapse.addDiv('Q3', 'fade=1');


animatedcollapse.addDiv('Q4', 'fade=1');


animatedcollapse.addDiv('Q5', 'fade=1');


animatedcollapse.addDiv('Q6', 'fade=1');


animatedcollapse.ontoggle=function($, divobj, state){ //fires each time a DIV is expanded/contracted


	//$: Access to jQuery


	//divobj: DOM reference to DIV being expanded/ collapsed. Use "divobj.id" to get its ID


	//state: "block" or "none", depending on state


}


animatedcollapse.init();











function sectionControl(secId){


	//hover menu section of secId


	$('#menu li').removeClass('hover');


	$('#menu_sec_'+secId).addClass('hover');


	


	//hide section box of secId


	//$('#sec_box_'+secId).hide();


	


	//change the color of inner page right table with secId color  


	//$('#sec_color').removeClass().addClass('td_'+secId);


}

$(document).ready(function(){
	$('.text_black_small p').css('text-align', 'left')	;
	$('.text_black_small div').css('text-align', 'left')	;					   
});

$(document).ready(function(){


	/*search*/ 


	//clear search filed 


	$('#searchCurrentField').click(function(){


		if($('#searchCurrentField').val() == 'Search')


			$('#searchCurrentField').val('');	 


	});


	//set the href of search link  


	$("#searchCurrentLink").click(function(){


		if( $('#searchCurrentField').val().length < 3  ){


			getOut($('#searchErrors'), 'Please write at least 3 characters.');


		}else{


			$(this).attr('href', siteUrl+'/news/search/current/'+$('#searchCurrentField').val());


	 		return true;


		}


	});





});





function keyHighlight(key){


	//highlight search key in results


	//alert(key)


	key = key.toLowerCase();


	$('#searchResults .keyHighlight').each(function(){


		$(this).html( $(this).text().toLowerCase().replace(key, '<span class="highlight">'+key+'</span>') );


	})	


}





function getOut(obj, message){


	obj.text(message).fadeTo("slow", 1, function(){


		setTimeout(


			function() {obj.text('').fadeOut("slow" , 1); }, 


			3000


		);																		 


	});


	return false;


}









