	function show_details(oElement){
		oDiv = document.getElementById('ad_' + oElement.id);
		if(!oElement.checked)
			oDiv.style.display='none';
		else
			oDiv.style.display='block';
	}

	function isEmpty(str) {
	   for (var i = 0; i < str.length; i++)
	      if (" " != str.charAt(i))
	          return false;
	      return true;
	}
	
	function checkfields(oForm){
		/*return;*/
		with (oForm){
			if(isEmpty(surname.value)){
				alert("Укажите, пожалуйста, ФИО");
				return false;
			}
			
			if (isEmpty(mail.value) && isEmpty(phone.value)){
				alert("Вы забыли оставить контактные данные");
				return false;
			} else {
				if (!isEmpty(mail.value)  && !(/^([a-z0-9_\-]+\.)*[a-z0-9_\-]+@([a-z0-9][a-z0-9\-]*[a-z0-9]\.)+[a-z]{2,4}$/i).test(mail.value)) {
					alert("В указанном e-mail допущена ошибка!");
					return false;
				}
			}
			if(!(webdesign.checked||support.checked||hosting.checked||corpident.checked||advertising.checked||promo.checked)&&isEmpty(text.value)) {
				alert('Для отправки заказа необходимо указать услугу или заполнить поле "Сообщение"');
				return false;
			}
			return true;
		}
	}
	
	function setValue(val, id){
		oElement = document.getElementById(id);
		if(oElement == null) return;
		
		if(isEmpty(oElement.value)) oElement.value = val;
	}

