	 var win
function showimage (w, h, path, title) {
		if (win) {
     win.close()
   }
	win = window.open('','','toolbar=no,scrollbar=no, width='+w+',height='+h+', top=100, left=100');
	win.document.open();
	win.document.write('<html><meta http-equiv="Content-Type" content="text/html; 	charset=windows-1251">\n<title>'+title+'</title>\n<body bgcolor="#ffffff" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0" bottommargin="0" rightmargin="0">\n<img src="'+path+'" border="0" alt="'+title+'">\n</html>');

}


function forestry(){
	var f = document.getElementById("selectforestry");
	var v = f.options[f.selectedIndex].value;
	if(v){

		var action="http://www.woodbusiness.ru/region.php?dossier=2&uid="+v;
		window.location.href = action;
	}
}

function isNatural(num) {
	var pattern = /^\d+$/;
	return (!num || !pattern.test(num) ? false : true);
}
function isDecimal(num) {
	var pattern = /^\d+\.?\d*$/;
	return (!num || !pattern.test(num) ? false : true);
}
function _isValidEmail(id_form_email, id_div) {
	var tf = isValidEmail(document.getElementById(id_form_email).value);
	if (!tf) 
		document.getElementById(id_div).style.display = "block";
	return tf;
}

function isValidEmail(email) {
	var pattern = /^[\w\.\-]+\@[\w\.\-]+\.[0-9a-z]{2,}$/;
	return (pattern.test(email) ? true : false);
}

function isValidURL(url) {
	var pattern = /^https?\:\/\/[\w\.\-]+\.[0-9a-z]{2,6}[\w\.\-\&\%\#\/\?\=\~\@]*$/;
	return (pattern.test(url) ? true : false);
}

var sent = false;
function Block() {
	if (sent) {
		return false;
	} else {
		sent = true;
		return true;
	}
}


function confirmSubmit(string) {
    var agree=confirm(string);
    if(agree) 
        return true; 
    else 
        return false;
}

function getElementComputedStyle(elem, prop){
	
	if (typeof elem!="object") elem = document.getElementById(elem);
				  
				  // external stylesheet for Mozilla, Opera 7+ and Safari 1.3+
	if (document.defaultView && document.defaultView.getComputedStyle)
	{
		if (prop.match(/[A-Z]/)){
			prop = prop.replace(/([A-Z])/g, "-$1").toLowerCase();
		}
		return document.defaultView.getComputedStyle(elem, "").getPropertyValue(prop);
	}
				  
				  // external stylesheet for Explorer and Opera 9
	if (elem.currentStyle)
	{
		var i;
		while ((i=prop.indexOf("-"))!=-1){
			prop = prop.substr(0, i) + prop.substr(i+1,1).toUpperCase() + prop.substr(i+2);
		}
		return elem.currentStyle[prop];
	}
				  
	return "";
}

function Set_Cookie( name, value, expires, path, domain, secure ) {
// set time, it's in milliseconds
	var today = new Date();
	today.setTime( today.getTime() );
	
	/*
	if the expires variable is set, make the correct 
	expires time, the current script below will set 
	it for x number of days, to make it for hours, 
	delete * 24, for minutes, delete * 60 * 24
	*/
	if ( expires ){
		expires = expires * 1000 * 60 * 60 * 24;
	}
	var expires_date = new Date( today.getTime() + (expires) );
	document.cookie = name + "=" +escape( value ) +
	( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
	( ( path ) ? ";path=" + path : "" ) + 
	( ( domain ) ? ";domain=" + domain : "" ) +
	( ( secure ) ? ";secure" : "" );
}