function setCookie(name, value, days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
		var expires = "; expires=" + date.toGMTString();
	}
	else var expires = "";
	document.cookie = name + "=" + value + expires + "; path=/";
}

function getCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for (var i = 0; i < ca.length; i++) {
		var c = ca[i];
		while (c.charAt(0) == ' ') c = c.substring(1, c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
	}
	return null;
}

function eraseCookie(name) {
	setCookie(name, "", -1);
}
function new_z() {$('#inf_2').fadeOut(500);$('#i_n7').load('/load/0-0-0-0-1 #addEntForm', function(){$('#ldF12, #ldF13, #ldF14, #ldF15').css('width','90%');document.getElementById('sbsc').checked=true;$('div[atr="td_fs"]').css('height','100px');$('.x-unselectable').hide();$('#ldM57').prepend('<select id="catn"><option value="0">- Выберите -<\/option><option value="1" onclick="$(\'#cus1\').click()">Написание скрипта<\/option><option value="2" onclick="$(\'#cus2\').click()">Настройка модулей и др. функций<\/option><option value="3" onclick="$(\'#cus3\').click()">Валидация<\/option><option value="4" onclick="$(\'#cus4\').click()">Модули и функции не по назначению<\/option><option value="5" onclick="$(\'#cus5\').click()">Работа с дизайном<\/option><option value="6" onclick="$(\'#cus6\').click()">Консультация<\/option><option value="7" onclick="$(\'#cus7\').click()">Посоветоваться (бесплатно)<\/option><option value="8" onclick="$(\'#cus8\').click()">Прочее<\/option><\/select>');$('#ldM13').hide();$('#kdsM3, #sbsctr').hide();$('#sts hr').hide();$('#ldM8').hide();$('#mdM30, #ldM46').hide();$('#ldM59').hide();$('#ldM25').hide();$('#ldM37, #ldM49').hide();$('#ldM28').hide();$('#ldM40').hide();$('#ldM43').hide();$('#mdM32').hide();$('#mdM32').hide();$('#ldM64, #tagsTd1, #tagsTd2').hide();$('#ldM52').hide();$('.inf_4 hr').hide();$('#ldF1').css('width','500px');$('#ldM61').hide();$('#inf_3').fadeIn(500);setTimeout(function(){$('#inf_3').fadeOut(500);},500);setTimeout(function(){$('.inf_4, #inf_5').fadeIn(500);},1000);});}
function new_ot() {$('#d1').show();$('#d2').hide();$('#d3').hide();$('#d4').hide();$('#otm').show();$('#otm2').hide();$('.inf_4, #inf_5').fadeOut(500);setTimeout(function(){$('#inf_2').fadeIn(500);$('#sh_8').html('<font size="6">Шаг 1<\/font><br />Выберите, пожалуйста, тип вашего заказа из предложенных в списке ниже (если нужного вам типа там нету - выберите тип "Прочее"), введите краткое описание (заголовок) заказа и нажмите "Далее".');},500);}
function new_d1() {$('#sh_8').fadeOut(500);$('#d1').hide();$('#d2').show();$('#d3').hide();$('#d4').hide();setTimeout(function(){$('#sh_8').fadeIn(500);},1000);$('#txtPart555message *:not(#message)').hide();$('#ldM8').attr('align','center');$('#message').css('width','90%');$('#ldM3').fadeOut(500);$('#ldM55').fadeOut(500);$('div[atr="td_fs"]').css('height','400px');setTimeout(function(){$('#ldM8').fadeIn(500);$('#sh_8').html('<font size="6">Шаг 2<\/font><br />Теперь составьте описание своего заказа. Пожалуйста, старайтесь описывать работу как можно подробнее.');},500);}
function new_d2() {$('#sh_8').fadeOut(500);$('#d1').hide();$('#d2').hide();$('#d3').show();$('#d4').hide();setTimeout(function(){$('#sh_8').fadeIn(500);},1000);$('#ldM8').hide();$('div[atr="td_fs"]').css('height','160px');setTimeout(function(){$('#ldM25, #ldM28').fadeIn(500);$('#sh_8').html('<font size="6">Шаг 3<\/font><br />Здесь вы можете прикрепить к заказу файл или изображение, нажав "Обзор" и выбрав нужный файл или изображение на компьютере. Если вы этого не хотите, просто пропустите шаг, нажав "Далее".');},500);}
function new_d3() {$('#sh_8').fadeOut(500);$('#d1').hide();$('#d2').hide();$('#d3').hide();$('#d4, #ldM46').show();setTimeout(function(){$('#sh_8').fadeIn(500);},1000);$('#ldM8').hide();$('div[atr="td_fs"]').css('height','210px');$('#ldM25, #ldM28').fadeOut(500);setTimeout(function(){$('#ldM13, #ldM37, #ldM40, #ldM43').fadeIn(500);$('#sh_8').html('<font size="6">Шаг 4<\/font><br />Введите предполагаемый бюджет в поле "Бюджет (в рублях)" (поле необязательное, также если вы выбрали категорию "Посоветоваться (бесплатно)", то заполнять поле <b>ненужно<\/b>). Также нужно ввести Ваше имя, E-mail, сайт, для которого или на котором будет проводиться работа и телефон по желанию.');},500);}
function ent_all() {$('#inf_2').fadeOut(500);setTimeout(function(){$('#all_ent').fadeIn(500);},500);}
function newm(){alert('success')}
function openery(){
try {var tr=checksubmit();if(!tr){return false;}}catch(e){}
document.getElementById('ldF18').disabled=true;
new _uWnd('addEnt','Добавление заказа',-310,-100,{autosize:0,modal:1,closeonesc:1,resize:0,success:newm},{form:'addEntForm'});
}
function r() {
new _uWnd('ajax','Редактирование профиля',800,500,{minh:500, autosize:0, autosizewidth:0, autosizeonimages:0},'<iframe src="/index/11" style="width:100%;height:100%;border:0px;"><\/iframe>');
}
function nrf() {$('.new_ref').animate({opacity:'0.2'},500);$('.new_ref').load(location.href+' .new_ref', function(){$('.new_ref').animate({opacity:'1'},500);})
};
function footer() {
$('img[src*="p_www.gif"], img[src*="p_icq.gif"]').css('vertical-align','-3px');
$('a[href*="/index/8"]:not(.signatureView a), a[href*="/index/14"]').click(function(){new _uWnd('ajax','Загрузка…',800,400,{maxh:500, autosizeonimages:1, hideonresize:1,fadeclosetype:1,fadetype:1,autosize:1},{xml:false,dataType:'html',url:this.href});$.get(this.href,{},function(data){if(data.search(/<title>(.+)<\/title>/i)) _uWnd.getbyname('ajax').setTitle(RegExp.$1);});return false;});
$('a[href="http://www.ucoz.ru/"], a[href*="unet.com"], .avatar a, .g-xpert, a[rel="nofollow"]:not(.reputationDo, .hdut, .banDo, .banPercent, .repHistory, .ngr, .posttdMessage a, .comments_te a, a[href*="u.to"], a[href*="mailto:"], .avat, .postNumberLink, a[class*="swch"], a[onclick*="prompt"], .modBut, .funcLink, a[class*="group"], .lastPostUserLink, .fNavLink, .lastUserLink, a[href*="index/40"]), .td_ps a, #rf_s, #rf_s2, a[href="#post"], a[href*="-0-0-1-1"], .sortArrDown, a .forumBarA, .sortArrUp, a[href*="-0-0-1-2"]').css('border-bottom','0px').css('vertical-align','-3px');
$.get('/index/14', function(data){
var ag = $('table tr', data).size();
var ag2 = $('table tr b', data).size();
$('#new_pm4').html(ag2-(ag-2));
var ls9 = $('#new_pm4').text();
if (getCookie('eng')) {
if (ls9!='0') {$('#ls_p').html($('#new_pm4').html());$('#new_pm4').append('<br /><a href="javascript://" onclick="$(\'div[class*=xt-close]\').click();$(\'#lsdf\').click();">Read »</a>');_uWnd.alert('<br />Not read messages: <b>'+$('#new_pm4').html()+'</b>','Check of messages',{w:240,autosize:true,tm:0});};
} else {
if (ls9!='0') {$('#ls_p').html($('#new_pm4').html());$('#new_pm4').append('<br /><a href="javascript://" onclick="$(\'div[class*=xt-close]\').click();$(\'#lsdf\').click();">Читать »</a>');_uWnd.alert('<br />Непрочитанных сообщений: <b>'+$('#new_pm4').html()+'</b>','Проверка сообщений',{w:240,autosize:true,tm:0});};
};
});
}
function footer_u() {
$('img[src*="p_www.gif"], img[src*="p_icq.gif"]').css('vertical-align','-3px');
$('a[href*="/index/8"]:not(.signatureView a), a[href*="/index/14"]').click(function(){new _uWnd('ajax','Загрузка…',800,400,{maxh:500, autosizeonimages:1, hideonresize:1,fadeclosetype:1,fadetype:1,autosize:1},{xml:false,dataType:'html',url:this.href});$.get(this.href,{},function(data){if(data.search(/<title>(.+)<\/title>/i)) _uWnd.getbyname('ajax').setTitle(RegExp.$1);});return false;});}
function nrf() {$('.new_ref').animate({opacity:'0.2'},500);$('.new_ref').load(location.href+' .new_ref', function(){$('.new_ref').animate({opacity:'1'},500);})
$('a[href="http://www.ucoz.ru/"], a[href*="unet.com"], .g-xpert, .avatar a, a[rel="nofollow"]:not(.reputationDo, .hdut, .banDo, .banPercent, .repHistory, .ngr, .posttdMessage a, .comments_te a, a[href*=u.to], a[href*="mailto:"], .avat, .postNumberLink, a[class*="swch"], a[onclick*="prompt"], .funcLink, a[class*="group"], .lastPostUserLink, .lastUserLink, .fNavLink, .modBut, a[href*="index/40"]), .td_ps a, #rf_s, #rf_s2, a[href="#post"], a[href*="-0-0-1-1"], .sortArrDown, a .forumBarA, .sortArrUp, a[href*="-0-0-1-2"]').css('border-bottom','0px').css('vertical-align','-3px');
};
function new_pm() {
$('div[class*="xt-close"]').click();
$.get('/index/14', function(data){
var ag = $('table tr', data).size();
var ag2 = $('table tr b', data).size();
$('#new_pm4').html(ag2-(ag-2));
var ls9 = $('#new_pm4').text();
if (getCookie('eng')) {
if (ls9!='0') {$('#ls_p').html($('#new_pm4').html());$('#new_pm4').append('<br /><a href="javascript://" onclick="$(\'div[class*=xt-close]\').click();$(\'#lsdf\').click();">Read »</a>')} else {$('#new_pm4').html('no');setTimeout(function(){$('div[class*="xt-close"]').click();},5000);};
} else {
if (ls9!='0') {$('#ls_p').html($('#new_pm4').html());$('#new_pm4').append('<br /><a href="javascript://" onclick="$(\'div[class*=xt-close]\').click();$(\'#lsdf\').click();">Читать »</a>')} else {$('#new_pm4').html('нет');setTimeout(function(){$('div[class*="xt-close"]').click();},5000);};
};
if (getCookie('eng')) {
setTimeout(function(){_uWnd.alert('<br />Not read messages: <b>'+$('#new_pm4').html()+'</b>','Check of messages',{w:240,autosize:true,tm:0});},500);
} else {
setTimeout(function(){_uWnd.alert('<br />Непрочитанных сообщений: <b>'+$('#new_pm4').html()+'</b>','Проверка сообщений',{w:240,autosize:true,tm:0});},500);
};
});};
function head(){function new_pm() {
$('div[class*="xt-close"]').click();
$.get('/index/14', function(data){
var ag = $('table tr', data).size();
var ag2 = $('table tr b', data).size();
$('#new_pm4').html(ag2-(ag-2));
var ls9 = $('#new_pm4').text();
if (getCookie('eng')) {
if (ls9!='0') {$('#ls_p').html($('#new_pm4').html());$('#new_pm4').append('<br /><a href="javascript://" onclick="$(\'div[class*=xt-close]\').click();$(\'#lsdf\').click();">Read »</a>')} else {$('#new_pm4').html('no');setTimeout(function(){$('div[class*="xt-close"]').click();},5000);};
} else {
if (ls9!='0') {$('#ls_p').html($('#new_pm4').html());$('#new_pm4').append('<br /><a href="javascript://" onclick="$(\'div[class*=xt-close]\').click();$(\'#lsdf\').click();">Читать »</a>')} else {$('#new_pm4').html('нет');setTimeout(function(){$('div[class*="xt-close"]').click();},5000);};
};
if (getCookie('eng')) {
setTimeout(function(){_uWnd.alert('<br />Not read messages: <b>'+$('#new_pm4').html()+'</b>','Check of messages',{w:240,autosize:true,tm:0});},500);
} else {
setTimeout(function(){_uWnd.alert('<br />Непрочитанных сообщений: <b>'+$('#new_pm4').html()+'</b>','Проверка сообщений',{w:240,autosize:true,tm:0});},500);
};
});};
};
function red_msg(id) {$('#redact3').html('<img src="/img/ajsml.gif" alt="" />');$('#msg_'+id).fadeOut(500);setTimeout(function(){$('#msg_'+id).load('/load/0-0-0-'+id+'-13 #addEntForm', function(){setTimeout(function(){$('#redact3').html('<a href="javascript://" onclick="document.getElementById(\'doSmbBt\').click();sbm2()">сохранить</a>');},500);$('#msg_'+id).fadeIn(500);$('#ldM13').hide();$('#kdsM3, #sbsctr').hide();$('#sts hr').hide();$('#mdM30').hide();$('#ldM59').hide();$('#ldM25').hide();$('#ldM37').hide();$('#ldM28').hide();$('#ldM40').hide();$('#ldM43').hide();$('#mdM32, #ldM13').hide();$('#mdM32').hide();$('#ldM64, #tagsTd1, #tagsTd2').hide();$('#ldM52, #ldM3, #ldM55').hide();$('#txtPart555message *:not(#message)').hide();$('#msg_'+id+' hr').hide();$('#ldM61').hide();});},500);}
function sbm2(id) {$('#msg_'+id).fadeOut(500);$('#redact4').html('<img src="/img/ajsml.gif" alt="" />');setTimeout(function(){$('#msg_'+id).load(location.href+' #msg_'+id, function(){$('#msg_'+id).fadeIn(500);$('#redact4').fadeOut(500);});},2000);}
function com_rf() {$('#cmma').animate({opacity:'0'},500);$('#ref_i').attr('src','/img/ajsml.gif');$('#cms2').html('<img src="/img/ajsml.gif">');$('#cms2').load(location.href+' #cms2');$('#cmn').load(location.href+' #cmn', function(){$('#cmma').animate({opacity:'1'},500);});}
function openery(){
try {var tr=checksubmit();if(!tr){return false;}}catch(e){}
document.getElementById('ldF18').disabled=true;
new _uWnd('addEnt','Добавление заказа',-310,-100,{autosize:0,modal:1,closeonesc:1,resize:0},{form:'addEntForm'});
}
function logon() {
$('#log2, #log, #pass2, #pass').css('padding-top','4px');
$('#log, #pass').css('padding-left','25px');
$('#log, #pass').css('width','72%');
};
rateForm=function(c,d,f,g){if(typeof d=='undefined'||typeof c=='undefined'||(c!=1&&c!=-1))return false;c+=2;if(!f)f=location.pathname.match(/[^\\\/]+/i)+'';if(!f)return false;var h=$('#rate_'+d);g=$.extend({'before':function(a){a.prev('a').remove();a.next('a').remove()},'after-success':function(a,b){a.html(b).addClass(b>0?'positiveRate':(b==0?'nullRate':'negativeRate'));_uWnd.alert('Оценка засчитана!')},'after-error':function(a){try{eval(a)}catch(e){}}},g||{});g.before(h);$.post('/'+f+'/',{'a':'65','id':d,'mark':c,'mod':f,'ajax':'2'},function(a){a=$('cmd:first',a).text();var b=a.match(/рейтинг:\s*([\d.]+)\/(\d+)/i);if(!b)return g['after-error'](a);b=Math.round(b[1]*b[2])-2*b[2];g['after-success'](h,b)})}