      function checkFill(formObj) {
        if (formObj.email.value == '') {
          alert('Ведите ваш e-mail');
          formObj.email.focus();
          return false;
        }
        if ( formObj.price.checked == false && formObj.item.checked == false && formObj.text.value == '') {
          alert('Отметьте причину несоответствия либо введите комментарий');
          return false;
        }
        return true;
      }
  function fixPngImage(p) {
    var imgsrc;
    var trans = "/gfx/page/spacer.gif";   
    if(typeof p.tested != undefined && !p.tested &&  typeof p.runtimeStyle != 'undefined') {
       // retain image src
       imgsrc = p.src;
  
       // make sure the image is a PING
       if ( /\.png$/.test( imgsrc.toLowerCase() ) ) {
         // If it is set it to a transparent image
      p.src = trans;
      // Set the runtime style to load the alpha image in the background
      p.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + imgsrc + "',sizingMethod='scale')";
      p.tested = true;
       }
     }
  }
function wo(link,ww,hh,title) {
	www=ww;
	if (hh>700 || www>1000) {
		if (hh>700) hhw=700;
		if (www>1000) www=1000;
		w=window.open(link,'',(ww ? 'width='+(www+18)+',' : '')+(hh ? 'height='+hhw+',' : '')+'toolbar=0,top=20,left=20,scrollbars=1,resizable');
	} else {
		hhw=hh;
		w=window.open(link,'',(ww ? 'width='+ww+',' : '')+(hh ? 'height='+hhw+',' : '')+'toolbar=0,top=20,left=20,scrollbars=0,resizable');
	}
	if (link.indexOf('.html')==-1) {
		if (document.layers) title='';
		w.document.open();
		w.document.write('<html><head><title>'+title+'</title><meta http-equiv=Content-Type content="text/html; charset=windows-1251"></head>');
		w.document.write('<body bgcolor=white marginwidth=0 marginheight=0 topmargin=0 leftmargin=0><table width=100% height=100% border=0 cellspacing=0 cellpadding=0><tr><td align=center><img src='+link+' width='+ww+' height='+hh+' border=0 alt="'+title+'"></td></tr></table></body></html>');
		w.document.close();
	}
	w.focus();
}
function wo2(link,ww,hh,title) {
	www=ww;
	if (hh>700 || www>1000) {
		if (hh>700) hhw=700;
		if (www>1000) www=1000;
		w=window.open(link,'',(ww ? 'width='+(www+18)+',' : '')+(hh ? 'height='+hhw+',' : '')+'toolbar=0,top=20,left=20,scrollbars=1,resizable');
	} else {
		hhw=hh;
		w=window.open(link,'',(ww ? 'width='+ww+',' : '')+(hh ? 'height='+hhw+',' : '')+'toolbar=0,top=20,left=20,scrollbars=0,resizable');
	}
	w.focus();
}
 function isEmail(sEmail){
		//sEmail = sEmail.replace( /\(.*?\)/, '' );
		oRegExp = /^[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*@[A-Za-z0-9][-\w]*(\.[A-Za-z0-9][-\w]*)*\.[a-zA-Z]{2,4}$/;
		return oRegExp.test(sEmail);
}
function isEmpty(str) {
	oReEmpty = /^\s*$/;
	return oReEmpty.test(str);
}

function checkRegForm(form) 
{
	var SendItem= 0;
	var AlertMessage;
	if (isEmpty(form.email.value)) {
		SendItem= 1; AlertMessage = 'Укажите Ваш E-mail';
	} else if (!isEmail(form.email.value)) {
		SendItem= 1; AlertMessage = 'Укажите правильный E-mail';
	} else if (isEmpty(form.name.value)) {
		SendItem= 1; AlertMessage = 'Укажите Имя';
	} else if (isEmpty(form.message.value)) {
		SendItem= 1; AlertMessage = 'Сообщение недолжно быть пустым!';
	} 	
	if (!SendItem) {
		form.submit();
	} else {
		alert(AlertMessage);
	}
}
function displayCities(value) 
{
	for(var i=1;i<4;i++)
	{
		document.getElementById('city_'+i).style.display='none';
	}
		document.getElementById('city_'+value).style.display='inline';
}
function reg_displayCities(value) 
{
	for(var i=1;i<4;i++)
	{
		document.getElementById('reg_city_'+i).style.display='none';
	}
		document.getElementById('reg_city_'+value).style.display='inline';
}
function advance_block(flag) 
{
	if(flag=='on'){
		document.getElementById('advanced').style.display='block';
		document.getElementById('link').style.display='none';
	}else{
		document.getElementById('link').style.display='block';
		document.getElementById('advanced').style.display='none';
	}
}
function display_sub(value) 
{
	if(document.getElementById('sub'+value).style.display=='none')
	{
		document.getElementById('sub'+value).style.display='block';
	}else{
		document.getElementById('sub'+value).style.display='none';
	}
}
function valDate() {
  var x;
  var y1 = new String, y2 = new String;
  var fDate = new Date;
  var fRE = /(\d{1,2})\.(\d{1,2})\.(\d{4})/;
  var fRE1 = /0(\d)\.(\d{1,2})\.(\d{4})/;
  var fRE2 = /(\d{1,2})\.0(\d)\.(\d{4})/;
  for (var i = 0; i < arguments.length; i++) {
    x = document.getElementById(arguments[i]);
    if (x) {
      y1 = x.value;
      y1.match(fRE);
      t1 = Number(RegExp.$1); t2 = Number(RegExp.$2) - 1; t3 = Number(RegExp.$3);
      var fDate = new Date(t3, t2, t1);
      y1 = y1.replace(fRE1, "$1.$2.$3"); y1 = y1.replace(fRE2, "$1.$2.$3");
      y2 = fDate.getDate() + "." + (fDate.getMonth() + 1) + "." + fDate.getFullYear();
      if (x && y1 && y1 != y2) {
        alert('введите дату (дд.мм.гггг) !');
        x.focus();
        return false;
      }
    }
  }
  return true;
}
function cf() {
	return window.confirm('Выключить аукцион?');
}
function cf2(value) {
	return window.confirm(value);
}
function show_block(id)
{
	if(document.getElementById('block_'+id).style.display=='block')
		document.getElementById('block_'+id).style.display='none';
	else
		document.getElementById('block_'+id).style.display='block'
}
function sel_all(obj)
{
  for (i = 0; i < document.price.elements.length; i++) {
    var el = document.price.elements[i];
    if (el.name == "to_del[]") el.checked = obj.checked;
    if (obj.checked) obj.title="Снять выделение со всех позиций";
    else obj.title="Выделить все позиции";
  }
}
function changeCurrency(currency_id)
{
	document.location.href=document.getElementById('idURL').value+'&currency_id='+currency_id;
}
function changeSsrt(ssrt)
{
	if(ssrt!=0)
		document.location.href=document.getElementById('idURL').value+'&ssrt='+ssrt;
}
function no_money(root)
{
	var confirm=window.confirm('У вас недостаточно средств для подключения раздела. Перейти на страницу пополнения баланса?');
	if(confirm)
	{
		document.location.href='/personal/points/';
		return false;
	}else{
		return false;
	}
}
function checkGM(money,points)
{
	var prCh=parseInt(money);
	if(money>points){
		alert("Введенная вами сумма превышает ваш баланс!");
		return false;
	}
	if(isNaN(prCh) || money<=0){
		alert("Пожалуйста правильно укажите сумму!");
		return false;
	}
	return true;
}

function checkCurrency(value)
{
	var prCh=parseInt(value);
	if(isNaN(prCh) || value<=0){
		alert("Пожалуйста правильно укажите сумму!");
		return false;
	}
	return true;
}