function setCookie (name, value, expires, path, domain, secure) {
	document.cookie = name + '=' + escape(value) +
	((expires) ? '; expires=' + expires : '') +
	((path) ? '; path=' + path : '') +
	((domain) ? '; domain=' + domain : '') +
	((secure) ? '; secure' : '');
}
function popUp(URL,width,height) {
  window.open(URL, 'popup', 'toolbar=0,scrollbars=1,location=0,status=0,menubar=0,resizable=0,width=' + width + ',height=' + height + ',left = 50,top = 50');
  return false;
}

function openWindow(URL,width,height) 
{
  window.open(URL, '_blank', 'toolbar=1,scrollbars=1,location=1,status=1,menubar=1,resizable=1,width=' + width + ',height=' + height + ',left = 50,top = 50');
}

var openBlock=false;
function openCloseTypeDescription() {
	if (document.getElementById('typeDescription')) var typeDescription = document.getElementById('typeDescription');
	if (document.getElementById('readMore')) var readMore = document.getElementById('readMore');
	if (!openBlock) {
 		typeDescription.style.height='auto';
		openBlock=true;
		readMore.firstChild.nodeValue='Закрыть';
	}	
	else {
		typeDescription.style.height='8em';
		openBlock=false;
		readMore.firstChild.nodeValue='Читать еще >>>';
	}
}

function GetXmlHttpObject() {
	var xmlHttp=null;
	try {// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	} catch (e) {// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
		}
	}
	return xmlHttp;
} 