var showInfo;function $i(id){    return document.getElementById(id);}function onShow(msg){document.getElementById('ajax_loading').style.display="block";}function onHide(){    document.getElementById('ajax_loading').style.display="none";}function doShowInfo(msg,type,hide){    if (hide)    {        clearTimeout(showInfo);        if (type==1)        {                        $('#ajax_info').hide('slow');        }else if (type==2)            {                $('#ajax_error').hide('slow');            }        return;    }    if (type==1)        {            $i('ajax_info').innerHTML=msg;            $('#ajax_info').show('slow');        }else if (type==2)            {                $i('ajax_error').innerHTML=msg;                $('#ajax_error').show('slow');            }    showInfo=setTimeout('doShowInfo(0,'+type+',1);',3000);}function TimerHide(){    //list_info    if (!$i('list_info'))    {        return;    }    info_timer=setTimeout('TimerDoHide();',3000);}function TimerDoHide(){    $i('list_info').style.display="none";    clearTimeout();}window.onload = function(){    TimerHide();}function ChangeItemActive(id){    onShow();    jQuery.ajax({    type: 'POST',    data:'id='+id,    dataType:'json',    url: script_self+'?mode=ajax&do=changeitemactive',    success: function(data){           onHide();        if (data.error)        {            doShowInfo(data.error,2);            return false;        }        if (data.msg)        {            doShowInfo(data.msg,1);        }        if (data.active)        {            $i('item_'+id).checked=data.active;        }        return false;    }});}<!--function SelectAll(mark) {  for (i = 0; i < document.forms['main'].elements.length; i++)     {         var item = document.forms['main'].elements[i];             if (item.alt == "id")  {                     item.checked = mark;                 };         }}//-->$(document).ready(function(){		//hide message_body after the first one	$(".message_list .message_body:gt(0)").hide();		//hide message li after the 5th	//$(".message_list li:gt(4)").hide();		//toggle message_body	$(".message_head").click(function(){		$(this).next(".message_body").slideToggle(500)		return false;	});	//collapse all messages    $(".show_all_portfolio").click(function(){		$(".show_all_portfolio").hide()		$(".hide_all_portfolio").show()		//$(".message_list li:gt(-1)").slideUp()        $(".message_body").slideDown(500);		return false;	});        $(".hide_all_portfolio").click(function(){		$(".hide_all_portfolio").hide()		$(".show_all_portfolio").show()		//$(".message_list li:gt(-1)").slideDown()        $(".message_body").slideUp(500)		return false;	});    	$(".collpase_all_message").click(function(){		$(".message_body").slideUp(500)		return false;	});	$(".collpase_all2_message").click(function(){		$(".message_body").slideDown(500)		return false;	});  $("#portfolio_list a.image_link").fancybox({        'zoomSpeedIn':  0,         'zoomSpeedOut': 0,         'overlayShow':  true      });});function doShowInfo(msg,type,hide){    if (hide)    {        clearTimeout(showInfo);        if (type==1)        {                        $('#ajax_info').hide('slow');        }else if (type==2)            {                $('#ajax_error').hide('slow');            }        return;    }    if (type==1)        {            $('#ajax_info').html(msg);            $('#ajax_info').show('slow');        }else if (type==2)            {                $('#ajax_error').html(msg);                $('#ajax_error').show('slow');            }    showInfo=setTimeout('doShowInfo(0,'+type+',1);',3000);}function DoFeedBack(){    if ($i('email').value=='')        {            $i('email').focus();            $i('i_sec').src='/inc/kcaptcha/index.php?'+Math.random(1000);            $i('img_sec').value='';            doShowInfo('Вы должны ввести ваш E-mail для ответа',2);            return false;        }    if ($i('content').value=='')        {            $i('content').focus();            $i('i_sec').src='/inc/kcaptcha/index.php?'+Math.random(1000);            $i('img_sec').value='';            doShowInfo('Вы должны ввести текст сообщения',2);            return false;        }    if ($i('img_sec').value=='')        {            $i('img_sec').focus();            $i('i_sec').src='/inc/kcaptcha/index.php?'+Math.random(1000);            $i('img_sec').value='';            doShowInfo('Вы должны ввести цифры который вы видите на картинке',2);            return false;        }jQuery.ajax({type: 'POST',data:'email='+$i('email').value+'&subject='+$i('subject').value+'&content='+$i('content').value+'&img_sec='+$i('img_sec').value,dataType:'json',url: host+'/AjaxFeedBack/',success: function(data){   //$i("loading").style.display='none';    if (data.error)    {        doShowInfo(data.error,2);        return false;    }    if (data.msg)        {            doShowInfo(data.msg,1);            $i('email').value='';            $i('subject').value='';            $i('content').value='';            $i('i_sec').src='/inc/kcaptcha/index.php?'+Math.random(1000);            $i('img_sec').value='';            return true;        }    return false;}});}
