function imedia_req (val_res){
     		if (!val_res) {
     						$('val_err').className="validation-advice show"; 
     						if (!Validation.get('validate-email').test($('request_form[mail]').value)) {$('mail_err').className="validation-advice show";}
     						else {$('mail_err').className="validation-advice hide";}
     						ResetForm();
     		}
     		else $('val_err').className="validation-advice hide";
     		
     		return false;
     	}
function ResetForm(){
     		form = document.getElementById('request_form')
    		var inputs=form.getElementsByTagName('input');
    		for(var i=0;i<inputs.length;i++){
    			if (inputs[i].type=="text") {inputs[i].focus(); inputs[i].blur();}
    		}
     	}



var isIE = (navigator.userAgent.indexOf('MSIE') >= 0) && (navigator.userAgent.indexOf('Opera') < 0)
var icoockies;


function writeCart() {
if(getCookie('cart')=='0' | getCookie('cart')=='' | getCookie('cart')==null){
	document.all('cart').innerHTML='Корзина пуста';}
	else
	{document.all('cart').innerHTML='Корзина (' + getCookie('cart') + ')' ;}
};

function getCookie(name) {
	var cookie = " " + document.cookie;
	var search = " " + name + "=";
	var setStr = null;
	var offset = 0;
	var end = 0;
	if (cookie.length > 0) {
		offset = cookie.indexOf(search);
		if (offset != -1) {
			offset += search.length;
			end = cookie.indexOf(";", offset)
			if (end == -1) {
				end = cookie.length;
			}
			setStr = unescape(cookie.substring(offset, end));
		}
	}
	return(setStr);
};

function setCookie (name, value, expires) {
	var secure='';
	var domain='';
	var path = '/';
	document.cookie = name + "=" + value +
	((expires) ? "; expires=" + expires : "") +
	((path) ? "; path=" + path : "") +
	((domain) ? "; domain=" + domain : "") +
	((secure) ? "; secure" : "");
}

function delCookie(name){
  var domain='';
  var path = '/';
  if (getCookie(name)){
		document.cookie = name + "=" +
		((p) ? "; path=" + path : "") +
		((d) ? "; domain=" + domain : "") +
		"; expires=Thu, 01-Jan-70 00:00:01 GMT";
  }
}