function cl_play()
{
 imusik=document.PLGCardform.sound_file.value;
 document.getElementById('dummyspan').innerHTML="<embed name='"+imusik+"' src='"+imusik+"' hidden=true autostart=true loop=false>";
}

 function cl_stop()
{
  imusik=document.PLGCardform.sound_file.value;
  document.getElementById('dummyspan').innerHTML="<embed name='"+imusik+"' src='"+imusik+"' hidden=true autostart=false loop=false>";
}

winsettings = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,';
function colorwin(){                 cyber=window.open('win.php?Info=Colors', 'info', winsettings + 'width=250,height=280') }
function bgroundwin(){                 cyber=window.open('win.php?Info=Background', 'info2',  winsettings + 'width=250,height=290') }
function emoticonwin(){                cyber=window.open('win.php?Info=Emoticons', 'info4', winsettings + 'width=430,height=370') }
function exturl(){                 cyber=window.open('win.php?Info=Custom', 'info5', winsettings + 'width=450,height=270') }
function notify(){                 cyber=window.open('win.php?Info=Notify', 'info6', winsettings + 'width=300,height=140') }
function fontface(){                 cyber=window.open('win.php?Info=Fonts', 'info7', winsettings + 'width=550,height=270') }
function stampwin(){                 cyber=window.open('win.php?Info=Stamp', 'info8', winsettings + 'width=250,height=290') }

function addrecp(formObj){
  NumberRecp = formObj.addrecip.options[formObj.addrecip.selectedIndex].value;
  if(NumberRecp != ""){
    window.location="create.php?" + query_string + "&addrecip=" + NumberRecp;
  }
}

 function add_mail()
{
 re=/^[a-z0-9_\.\-]+@[a-z0-9_\.\-]+\.[a-z]{2,4}$/;

 email=document.PLGCardform.email.value;
 name=document.PLGCardform.name.value;

   if (name == "")
     {
       alert("Введите имя адресата");
       return;
     }
   else
    if (email == "")
     {
       alert("Введите e-mail адресата");
       return;
     }
   else
    if (!email.match(re))
     {
       alert('Неправильный формат e-mail');
       return;
     }

     i1=document.PLGCardform.sel.options[document.PLGCardform.sel.length-1].value.indexOf("<")+1;
     i2=document.PLGCardform.sel.options[document.PLGCardform.sel.length-1].value.indexOf(">");

    if (email == document.PLGCardform.sel.options[document.PLGCardform.sel.length-1].value.substring(i1,i2))
      {
       alert('Этот e-mail уже введен');
       return;
      }

    if (document.PLGCardform.sel.length >= 6)
     {
       alert('Максимальное число адресатов - 5');
       return;
     }

        opt = new Option(name+" "+email, name+" | "+email, false, false);
        document.PLGCardform.sel.options[document.PLGCardform.sel.length] = opt;
        xname=name;
        xemail=email;
        eval("document.PLGCardform.name"+(document.PLGCardform.sel.length-1)+".value=xname;");
        eval("document.PLGCardform.email"+(document.PLGCardform.sel.length-1)+".value=xemail;");
        document.PLGCardform.email.value = "";
        document.PLGCardform.name.value = "";

}
 function del_mail()
{
   sel = document.PLGCardform.sel;
     i=0;
   while(i<sel.length)
    {
      if(sel.options[i].selected && (sel.options[i].value != 0))
        {
         sel.options[i] = null;
         eval("document.PLGCardform.name"+i+".value=''");
         eval("document.PLGCardform.email"+i+".value=''");
         }
      else
         i++;
    }
}



 function hidecities()
{
 document.getElementById('city').style.display = "none";
}
 function showcities()
{
 if (document.user_reg.userCountry.selectedIndex == 0)
 document.getElementById('inp').style.display = "block";
 if (document.user_reg.userCountry.selectedIndex == 1)
 document.getElementById('city').style.display = "block";
 else
 document.getElementById('city').style.display = "none";
}
 function showinput()
{
 if (document.user_reg.userCity.selectedIndex == 0)
 document.getElementById('inp').style.display = "block";
 else
 document.getElementById('inp').style.display = "none";
}


////////////////////////////////////////////////////////////////
function sort_items_by_price()
{ 
 if(document.items_by_price.price_max_sort.value=="1")
 {
  document.items_by_price.price_max_sort.value="0";  
 }
 else
 {
  document.items_by_price.price_max_sort.value="1";
 }
  
 document.items_by_price.submit();
}




