function OpenWin(url,wname,opts) {
  newin=window.open(url,wname,opts);
  newin.focus();
}

function SubCat(num,sign,close) {
  var i,other;
  if (sign=='p')
    other='m';
  else
    other='p';
  if (document.getElementById("m1p")=='undefined')
    return;
  for (i=1; i<100; i++) {
    if (document.getElementById("m"+i+"p")) {
      if (num==i) {
        document.getElementById("m"+i+sign).style.display = "none";
        document.getElementById("m"+i+other).style.display = "block";
      }
      else if (close) {
        document.getElementById("m"+i+"p").style.display = "block";
        document.getElementById("m"+i+"m").style.display = "none";
      }
    }
  }
}

Image1= new Image(32, 32);
Image1.src = "http://landc.ru/i/ajax-loader.gif";

function ToBasket(pid, col, tester, htmlName) {
  basket = '';
  url    = '/cgi-bin/site.cgi?m=buy&id=';

  bParam = url + pid + '&c=' + col + '&t=' + tester;

  myPrice=document.getElementById(htmlName);

  myPrice.innerHTML="<img src=http://landc.ru/i/ajax-loader.gif border=0 width=32 height=32>";

  loadXMLDoc(bParam, htmlName);
}

function ShowHide(name) {
  if (!document.getElementById(name))
    return
  if (document.getElementById(name).style.display=='block')
    document.getElementById(name).style.display='none'
  else
    document.getElementById(name).style.display='block'
}

function MayOrder() {
  dpr=document.palette.radio;
  if (dpr==undefined) 
  {
    return;
  }
  flag=0;
  if (dpr.length) {
    for (i=0;i<dpr.length;i++) {
      if (dpr[i].selected) {
        flag=1;
        break;
      }
    }
  }
}

function CheckFace() {
  if (document.step2.bo.value==3) {
    document.step2.skin.disabled=false;
    document.step2.age.disabled=false;
  }
  else {
    document.step2.skin.disabled=true;
    document.step2.skin.value=0;
    document.step2.age.disabled=true;
    document.step2.age.value=0;
  }
}

function CheckComment() {
  comment=document.forms['comment'];
  if (comment.name.value!='' && comment.text.value!='') 
    comment.submit()
  else
    alert('Çàïîëíèòå, ïîæàëóéñòà, âñå ïîëÿ (òîëüêî e-mail íå îáÿçàòåëüíî)')
}

function RightTimeSpan(from, to) {
  tf=document.getElementById("time_from");
  tt=document.getElementById("time_to");
  tf_index=tf.selectedIndex;
  tt_index=tt.selectedIndex;

  if (from) {
    if (tt_index<tf_index) {
      tt.selectedIndex=tf_index
    }
  }
  else {
    if (tf_index>tt_index) {
      tf.selectedIndex=tt_index
    }
  }
}

function CreateBookmarkLink() {
  title = "ˆ­â¥à­¥â-¬ £ §¨­ ª®á¬¥â¨ª¨ Love and Care"; 
  url = "http://beauty.loveandcare.ru/";

  if (window.sidebar) { // Mozilla Firefox Bookmark
    window.sidebar.addPanel(title, url,"");
  } else if( window.external ) { // IE Favorite
    window.external.AddFavorite( url, title); }
  else if(window.opera && window.print) { // Opera Hotlist
    return true; }
}

function IfEmailDisabled()
{
  absent_email = document.getElementById('absent_email');
  absent_email.disabled = sub_absent_checked == 0;
  absent_submit = document.getElementById('absent_submit');
  absent_submit.disabled = sub_absent_checked == 0;
}

function CheckSubAbsent(val)
{
  if (val == 0) {
    sub_absent_checked--;
  }
  else {
    sub_absent_checked++;
  }
  IfEmailDisabled();
}

