var css_on = "#1F406E";
var css_off = "#657989";
var fl_search = false;

function flash(version, filename, name, width, height, wmode, bgcolor, menu, flashvars, salign) {
	salign==false ? salign="lt":"";
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+width+'" height="'+height+'" id="'+name+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain"/>');
	document.write('<param name="allowFullScreen" value="true"/>');
	document.write('<param name="wmode" value="'+wmode+'"/>');
	document.write('<!-- Flash FIX v0.3 | www.mega.by -->');
	document.write('<param name="bgcolor" value="'+bgcolor+'"/>');
	document.write('<param name="salign" value="'+salign+'"/>');
	document.write('<param name="movie" value="'+filename+'"/>');
	document.write('<param name="menu" value="'+menu+'"/>');
	document.write('<param name="quality" value="high"/>');
	document.write('<param name="flashvars" value="'+flashvars+'"/>');
	document.write('<embed src="'+filename+'" wmode="'+wmode+'" menu="'+menu+'" quality="high" flashvars="'+flashvars+'" salign="'+salign+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+name+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>');
	document.write('</object>');
	return true;
}

function flash_innerHTML(version, filename, name, width, height, wmode, bgcolor, menu, flashvars, salign) {
	salign==false ? salign="lt":"";
	htmlText='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+width+'" height="'+height+'" id="'+name+'" align="middle">'
	+'<param name="allowScriptAccess" value="sameDomain"/>'
	+'<param name="allowFullScreen" value="true"/>'
	+'<param name="wmode" value="'+wmode+'"/>'
	+'<!-- Flash FIX v0.3 | www.mega.by -->'
	+'<param name="bgcolor" value="'+bgcolor+'"/>'
	+'<param name="salign" value="'+salign+'"/>'
	+'<param name="movie" value="'+filename+'"/>'
	+'<param name="menu" value="'+menu+'"/>'
	+'<param name="quality" value="high"/>'
	+'<param name="flashvars" value="'+flashvars+'"/>'
	+'<embed src="'+filename+'" wmode="'+wmode+'" menu="'+menu+'" quality="high" flashvars="'+flashvars+'" salign="'+salign+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+name+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
	+'</object>';
	return htmlText;
}

function wmv(version, filename, id, width, height, AutoStart, BufferingTime, ShowControls, ShowPositionControls, ShowAudioControls, ShowTracker, ShowDisplay, ShowStatusBar, ShowGotoBar, ShowCaptioning, EnableContextMenu, EnableFullScreenControls, Enabled, WindowlessVideo) {
	document.write('<object classid="CLSID:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codeBase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version='+version+'" id="'+id+'" type="application/x-oleobject" width="'+width+'" height="'+height+'" viewastext>');
	document.write('<param name="FileName" value="'+filename+'">');
	document.write('<param name="AutoStart" value="'+AutoStart+'">');
	document.write('<param name="BufferingTime" value="'+BufferingTime+'">');
	document.write('<param name="ShowControls" value="'+ShowControls+'">');
	document.write('<param name="ShowPositionControls" value="'+ShowPositionControls+'">');
	document.write('<param name="ShowAudioControls" value="'+ShowAudioControls+'">');
	document.write('<param name="ShowTracker" value="'+ShowTracker+'">');
	document.write('<param name="ShowDisplay" value="'+ShowDisplay+'">');
	document.write('<param name="ShowStatusBar" value="'+ShowStatusBar+'">');
	document.write('<param name="ShowGotoBar" value="'+ShowGotoBar+'">');
	document.write('<param name="ShowCaptioning" value="'+ShowCaptioning+'">');
	document.write('<param name="EnableContextMenu" value="'+EnableContextMenu+'">');
	document.write('<param name="EnableFullScreenControls" value="'+EnableFullScreenControls+'">');
	document.write('<param name="Enabled" value="'+Enabled+'">');
	document.write('<param name="WindowlessVideo" value="'+WindowlessVideo+'">');
	document.write('<embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/Downloads/Contents/Products/MediaPlayer/" src="'+filename+'" name="'+id+'" width="'+width+'" height="'+height+'" AutoStart="'+AutoStart+'" BufferingTime="'+BufferingTime+'" ShowControls="'+ShowControls+'" ShowPositionControls="'+ShowPositionControls+'" ShowAudioControls="'+ShowAudioControls+'" ShowTracker="'+ShowTracker+'" ShowDisplay="'+ShowDisplay+'" ShowStatusBar="'+ShowStatusBar+'" ShowGotoBar="'+ShowGotoBar+'" ShowCaptioning="'+ShowCaptioning+'" EnableContextMenu="'+EnableContextMenu+'" EnableFullScreenControls="'+EnableFullScreenControls+'" Enabled="'+Enabled+'" WindowlessVideo="'+WindowlessVideo+'"></embed>');
	document.write('</object>');
}

function zoom(url, title, w, h) {
	zoomw=window.open("about:blank", "_blank", "width="+(w+20)+", height="+(h+20));
	zoomw.document.write("<html><head><title>"+title+"</title></head><body style='margin:0px; background:#000000;'>");
	zoomw.document.write("<center><table cellpadding='0' cellpading='0' width='100%' height='100%'><tr><td width='100%' height='100%' align='center' valign='middle'>");
	zoomw.document.write("<img src='"+url+"' width='"+w+"' height='"+h+"'>");
	zoomw.document.write("</td></tr></table>");
	zoomw.document.write("</center></body></html>");
}

function email(name, domain, tld, text, subject) {
	if(subject) {
	} else {
		subject='From site';
	}
	if(text) {
		if(subject) {
			document.write('<a href="mailto:'+name+'@'+domain+'.'+tld+'?Subject='+subject+'">'+text+'</a>');
		} else {
		}
	} else {
		document.write('<a href="mailto:'+name+'@'+domain+'.'+tld+'?Subject='+subject+'">'+name+'@'+domain+'.'+tld+'</a>');
	}
}

function f_login() {
	if (document.getElementById('login_form').style.display=='none') {
		document.getElementById('login_form').style.display='block';
		document.getElementById('opacity_div').style.display='block';
	} else {
		document.getElementById('login_form').style.display='none';
		document.getElementById('opacity_div').style.display='none';
	}
}

function f_escape(event) {
	if (event.keyCode==27 && document.getElementById('login_form').style.display!='none') f_login();
}

function f_resize_div() {
	document.getElementById('opacity_div').style.height=document.getElementById('wrapper').offsetHeight+'px';
	document.getElementById('opacity_div').style.width=document.getElementById('top').offsetWidth+'px';
}

var menuids=["menutree"];
function buildsubmenus() {
	for (var i=0; i<menuids.length; i++){
		var ultags=document.getElementById(menuids[i]).getElementsByTagName("ul");
		for (var t=0; t<ultags.length; t++) {
			if (ultags[t].parentNode.parentNode.id==menuids[i]) {
				ultags[t].style.left=ultags[t].parentNode.offsetLeft-2+"px";
				ultags[t].style.top=ultags[t].parentNode.offsetTop+ultags[t].parentNode.offsetHeight+"px";
			} else
				ultags[t].style.left=ultags[t-1].getElementsByTagName("a")[0].offsetWidth+"px";
				ultags[t].parentNode.onmouseover=function(){
					this.getElementsByTagName("ul")[0].style.display="block";
				}
				ultags[t].parentNode.onmouseout=function(){
					this.getElementsByTagName("ul")[0].style.display="none";
				}
		}
		for (var t=ultags.length-1; t>-1; t--){
			ultags[t].style.visibility="visible";
			ultags[t].style.display="none";
		}
	}
}