     function getRadioValue(radioObject)      /* определения состояния radio */
     {
          var value = null;
          for (var i=0; i<radioObject.length; i++) {
               if (radioObject[i].checked) {
                    value = radioObject[i].value;
                    break;
               }
          }
          return value;
     }

     function showSelectionValue(objectName)      /* опредедение состояния select */
     {
          var list = "";
          for (var i=0; i<objectName.length; i++) {
               if (objectName.options[i].selected) {
                    list += objectName.options[i].value ;
               }
          }
          return (list) ;
     }


     function showSelectionText(objectName)
     {
          var list = "";
          for (var i=0; i<objectName.length; i++) {
               if (objectName.options[i].selected) {
                    list += objectName.options[i].text ;
               }
          }
          return (list) ;
     }

     function exe_cmd(cmd,pkey,table_name)
     { document.getElementById('cmd').value=cmd ;
       if (pkey!=undefined) document.getElementById('pkey').value=pkey ;
       if (table_name!=undefined) document.getElementById('table_name').value=table_name ;
       window.document.forms.form.submit() ;
     }

     function exe_set_source(source,pkey)
     { document.getElementById('source2').value=source ;
       document.getElementById('cmd').value='' ;
       if (pkey!=undefined) document.getElementById('pkey').value=pkey ;
       window.document.forms.form.submit() ;
     }

     function exe_set_page(page)
     { document.getElementById('current_page').value=page ;
       document.getElementById('cmd').value='goto_page' ;
       window.document.forms.form.submit() ;
     }

   function validemail()
   {
     if ((document.contact.yourmail.value.length==0)||(document.contact.yourmail.value.length>0 && document.contact.yourmail.value.indexOf("@")==-1))
     {   alert("Пожалуйста укажите корректный Email для обратной связи!");
         return false;
     }
     if (document.contact.inform.value.length==0) { alert("Введите текст сообщения"); return false; }
      return true;
   }

	 function cart_wnd(pkey)
	 {
	 	window.open("cart.php?add_item="+pkey,"cart","status=1,dependent=1,width=260,height=115, resizable=0, status=no,menubar=no,toolbar=no,scrollbars=no") ;

	 }

	 function show_cart()
	 {
	 	if (document.getElementById('cart_status')==null) window.location.href='cart.php' ;
	 	 else { window.opener.location.href='cart.php' ;
	 	 		window.close() ;
	 	 	  }
	 }

	 function checkfield2()
		 { var _name=document.getElementById("_obj_name") ;
		    var _phone=document.getElementById("_uphone") ;
		    if (_name.value=='' || _phone.value=='') { alert('Внимание! Незаполнены обязательные поля!'); return false; }
		      else return true;
		 }

function OpenPopup(img_src,w,h)
      {
	   var sName = "popup";
	   var sFeatures = "height="+h+",width="+w+",status=no,toolbar=no,menubar=no,location=no,resizable=no,scrollbars=no" ;
	   var win = window.open(img_src, sName, sFeatures,true);
  	   return false;
      }

