
/* after load rather than document.ready*/
$(window).load(function(){
	// highlights and events merge
	
    
	// add the elements from the second set to the first
	$(".sidetabs:eq(0)").append($(".sidetabs:eq(1)/li")[0])
	
	//$(".tabborder/.content:eq(0)").attr("style","border:1px solid red")
	$(".tabborder/.content:eq(0)").append($(".tabborder/.content:eq(1)/ul")[0])
	
	// all now merged - tidy up before hiding event content
	$(".sidetabs:eq(1)").remove()
    $(".tabborder:eq(1)").remove()

	// hide event content
	$(".tabborder/.content/ul:eq(1)").hide()
	
	// set the active tab
	$(".sidetabs/li:eq(0)").addClass("tabactive")
	$(".sidetabs/li:eq(1)").removeClass("tabactive")

	//add anchors
	var text = $(".sidetabs/li:eq(0)").text()
	 $(".sidetabs/li:eq(0)").empty()
	 $(".sidetabs/li:eq(0)").append("<a href=\"\">"+text+"<"+"/a>")
	 
	 var text = $(".sidetabs/li:eq(1)").text()
	 $(".sidetabs/li:eq(1)").empty()
	 $(".sidetabs/li:eq(1)").append("<a href=\"\">"+text+"<"+"/a>")
	 
	 //assign actions to the anchors
	 $(".sidetabs/li/a").click(function(){
	 	var i = $(".sidetabs/li/a").index($(this)[0]);
	 	$(".sidetabs/li").removeClass("tabactive");
	 	$(this).parent().addClass("tabactive");
	 	$(".tabborder/.content/ul").hide()
	 	$(".tabborder/.content/ul:eq("+i+")").show()
	 	return false;
	 });
	 
	
	
	$('div#cp').cycle( { pause: 1, speed: 250, fade: 1 } );

   
});

