$(document).ready(function () {




if (typeof jQuery.ui != 'undefined') {
$("#tabs" ).tabs({
        select: function(event, ui) {
        var url = $.data(ui.tab, 'load.tabs');
        	if( url ) {
            		location.href = url;
            		return false;
        	}
        	return true;
	}
});             
}


$("a#numberone").click(function(e){ e.preventDefault(); });
$("a#numberone").css("cursor", "default");

$('div.fullrasptop a[id^="cat"]').click(function(e){ e.preventDefault(); });
$('div.fullrasptop a[id^="cat"]').css("cursor", "default");
$('div.fullrasptop a[id^="cat"]').css("text-decoration", "none");

$('a[href="http://informer.4dk.ru/specialist.html"]').each(function() {

		$(this).attr("href", "program/" + $(this).parent().find("span[name='chpu']").text());

});

if ($("div.paginator").length && $("div.paginator a#first").length && $("div.paginator a#last").length==0) { $("div.paginator").append("<img src=/images/last-page-bg.png>"); }
if ($("div.paginator").length && $("div.paginator a#last").length && $("div.paginator a#first").length==0) { $("div.paginator").prepend("<img src=/images/first-page-bg.png>"); }
                                     
$("input#spmchk1").prop("checked", 1);
$("input#spmchk1").prop("value", 2);


if (document.location.href.match(/form\d\d?.php/)){

//$("input#printLnk").click(function() { $("form[action*='form']").submit();});


}




if (document.location.href.match(/konkurs/))
{

	$("input#submithistorybtn1").css("background", "url('images/cont-request-btndisabled.png')");
	$("input#submithistorybtn1").css("cursor", "default");

	$("a[href*='buh']").filter(function(){
		return $(this).text().match(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/);
	}).remove();

	if (document.title.match(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)) document.title='История';

 	$("a:contains('комментариев 0')").text('Добавить комментарий');

	if (document.location.href.match(/konkurs_2.html/)) {
	 	$("li#new").addClass("current");
		$("li#best").removeClass("current");
	}

	$("input[name='user_f_4']").live("change", function() {

		if ($("input[name='user_f_4']").attr("checked") != 'checked') { 
				$("input#submithistorybtn1").attr("disabled", "disabled");
				$("input#submithistorybtn1").css("background", "url('/images/cont-request-btndisabled.png')");
				$("input#submithistorybtn1").css("cursor", "default");
		 }

		else { 
			$("input#submithistorybtn1").css("background", "url('images/cont-request-btn.png')");
			$("input#submithistorybtn1").removeAttr("disabled"); 
			$("input#submithistorybtn1").css("cursor", "pointer");

		}
		
	});

}

if (document.location.href.match(/buh_kon/))
{

	if (document.title.match(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/)) document.title='История';

	$("h1").filter(function(){ 
		return $(this).text().match(/^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/);
	}).text("История");

}



});


function changemama () {
now = new Date();
if (now.getDay() != 5)
{

	//юморичесткий ролек для рукавадетиля

	if (Math.floor(Math.random()*2))
	{
		$("div.news-part2 h3").text("Видео для бухгалтера");
		$("div.news-part2-txt a").text("Подвиги бухгалтера. Часть I");
		$("div.news-part2-txt a").attr("href", "http://4dk-consultant.ru/funvideo/videonovosti_dlya_buhgaltera1/podvigi_buhgaltera_chast_i/");
		$("div.news-part2-video img").attr("src", "http://4dk-consultant.ru/images/07_11_11video.png");
		$("div.news-part2-video a").attr("href", "http://4dk-consultant.ru/funvideo/videonovosti_dlya_buhgaltera1/podvigi_buhgaltera_chast_i/");
		$("div.news-part2-txt span").text("Юмористический ролик");
	}
	else
	{
       		$("div.news-part2 h3").text("Видео для руководителя");
		$("div.news-part2-txt a").text("Юмористический ролик для руководителя");
		$("div.news-part2-txt a").attr("href", "http://4dk-consultant.ru/funvideo/videonovosti_dlya_buhgaltera1/soveshanie_u_rukovoditelya/");
		$("div.news-part2-video img").attr("src", "http://4dk-consultant.ru/images/03_10_11video.png");
		$("div.news-part2-video a").attr("href", "http://4dk-consultant.ru/funvideo/videonovosti_dlya_buhgaltera1/soveshanie_u_rukovoditelya/");
		$("div.news-part2-txt span").text("Юмористический ролик");

	}
}





}
