$(document).ready(function(){



$("#ctabs a").each(function(){

var nowtab = $("#ctabs").prev().val();

var thisa = $(this).text();


if(nowtab=="Registrants Stage 1"){
	$("#ctabs a:first-child").addClass("nowtabon");
} 

if(nowtab==thisa){ 
	$(this).addClass("nowtabon");
}



});



$(".noonebg h3 a").each(function(){

var thetext = $(this).text().length;

if (thetext > '55'){								 

var newtext = $(this).text().substr(0,50);

var parts = newtext.split(' ');

var part = parts[parts.length - 1];

var newtext2 = newtext.replace(part,'...');

$(this).html(newtext2);

} else {

	

}



});

	

$(".topbox a").hover(function(){

$(this)	.animate({top: "3"},200);}, function(){ $(this).animate({top: "0"},200);

});

	

	

$(".isnews div").hide();

$("h2.mc").hide();

$("h2.widgettitle").html("<a target='_blank' href='http://twitter.com/MYselangorstory'><img src='/wp-content/themes/mss/images/twitter-update.png'></a>");

		   $(".isnews h2").click(function() {

     $(this).next("div").stop(true,true).slideToggle("slow");

   });

		   $(".ebtn").click(function() {

     $(".isnews h2.mc").hide(),$(".isnews h2.ec").show(),$("h2.mc").next("div").hide(),$("h2.ec");

	});

		   $(".mbtn").click(function() {

     $(".isnews h2.ec").hide(),$(".isnews h2.mc").show(),$("h2.ec").next("div").hide(),$("h2.mc");

	});

		   $(".isnews div").click(function() {

     $(this).stop(true,true).slideToggle("slow");

   });

});


