

function rerenderBtn(){
   $("input.btn_light_new").each(function(){
		singleRerender($(this),"btn_light_new");
	});
   $("input.btn_medium_new").each(function(){
		singleRerender($(this),"btn_medium_new");
	});
   $("input.btn_dark_new").each(function(){
		singleRerender($(this),"btn_dark_new");
	});
	
	$("a.btn_light_new").each(function(){
		singleRerender($(this),"btn_light_new");
	});
   $("a.btn_medium_new").each(function(){
		singleRerender($(this),"btn_medium_new");
	});
   $("a.btn_dark_new").each(function(){
		singleRerender($(this),"btn_dark_new");
	});
}

function rerenderAjaxBtn(){
   $("input.btn_Ajax_light_new").each(function(){
		singleRerender($(this),"btn_Ajax_light_new");
	});
   $("input.btn_Ajax_medium_new").each(function(){
		singleRerender($(this),"btn_Ajax_medium_new");
	});
   $("input.btn_Ajax_dark_new").each(function(){
		singleRerender($(this),"btn_Ajax_dark_new");
	});
	
	 $("a.btn_Ajax_light_new").each(function(){
		singleRerender($(this),"btn_Ajax_light_new");
	});
   $("a.btn_Ajax_medium_new").each(function(){
		singleRerender($(this),"btn_Ajax_medium_new");
	});
   $("a.btn_Ajax_dark_new").each(function(){
		singleRerender($(this),"btn_Ajax_dark_new");
	});
}

function singleRerender(jQueryObj,strClsName){
	if(!jQueryObj.parent().parent().get(0).className||jQueryObj.parent().parent().get(0).className!=strClsName+"_l")
	{
		var _btn = jQueryObj.wrap("<span class='"+strClsName+"_l'><span class='"+strClsName+"_r'></span></span>").bind("click", function(e){e.stopPropagation();});
		jQueryObj.parent().parent().click(function(e){
			_btn.click();
		});
		jQueryObj.parent().parent().mousedown(function(e){
			$(this).toggleClass(strClsName+"_l_mousedown");
			$(this).children().toggleClass(strClsName+"_r_mousedown");
		});
		jQueryObj.parent().parent().mouseup(function(e){
			$(this).toggleClass(strClsName+"_l_mousedown");
			$(this).children().toggleClass(strClsName+"_r_mousedown");
		});
	}
}