	
function show(link, w, h) {
	xx = window.open("","link","menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=no, resizable=no, width= " + w + ", height=" + h);
	out = "<html><head><title>Просмотр</title></head><body style='margin: 0 0 0 0;'><table cellpadding=0 cellspacing=0><tr><td><a href='javascript:window.close();'><img src='" + link + "' border=0 alt='закрыть'></a></td></tr></table></body></html>";
	xx.document.write(out);
	xx.focus();
	}
	
function html(link, w, h) {
	newWindow = window.open(link, "link", "top=30, left=30, menubar=no, toolbar=no, location=no, directories=no, status=no, scrollbars=yes, resizable=yes, width= " + w + ", height="+ h);
	newWindow.focus();
	}

	
	
function newW() {
	var newWindow = null  ;

	newWindow = window.open("","newW",'top=130, left=130, menubar=0, toolbar=1, location=1, directories=0, status=0, scrollbars=no, resizable=yes, width=400, height=200')
	document.form.target = "newW" ;
	
			
	if (!newWindow || newWindow.closed)
		newWindow = window.open("","newW","")
	else
		newWindow.focus()

	return;
	}

	
	
	
function check() {

	if ( document.form.name.value == "" && document.form.mail.value == "" && document.form.subject.value == "" && document.form.body.value == "") {
		alert("Ни одно поле не заполнено!\n");
		return false;
		}
		else { 
			newW(); 
			form.submit();
			}

}



function faq() {

	if ( document.faq.quest.value == "" && document.form.name.value == "") {
		alert("Ни одно поле не заполнено!\n");
		return false;
		}
		else { 
			newW(); 
			faq.submit();
			}

}


function showInnerWin() {

	var el = document.getElementById("loginwin");
	if(el) {
	el.style.display = 'block';
	}
	
	var el = document.getElementById("svetofor");
	if(el) {
		el.style.display = 'none';
		}
}

function closeInnerWin()
{
	var el = parent.document.getElementById("loginwin");
	el.style.display = 'none';

	var el = document.getElementById("svetofor");
	if(el)
	{
		el.style.display = 'block';
	}
}



function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	}
	else var expires = "";
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}



function run_movie(swf, w, h) { 
text = "<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" width=\"" + w + "\" height=\"" + h + "\">\r\n";
text+= "<param name=\"allowScriptAccess\" value=\"sameDomain\">\r\n";
text+="<param name=\"movie\" value=\"" + swf + "\">\r\n";
text+="<param name=\"menu\" value=\"false\">\r\n";
text+="<param name=\"quality\" value=\"high\">\r\n";
text+="<param name=\"bgcolor\" value=\"#ffffff\">\r\n";
text+="<embed src=\"" + swf + "\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\"" + w + "\" height=\"" + h + "\" menu=\"false\" bgcolor=\"#ffffff\" allowScriptAccess=\"sameDomain\">\r\n";
text+="</object>\r\n";

document.write(text);
return 1;
} 
