function d_load(url) {
	var request   = false;
	var msxmlhttp = new Array('Msxml2.XMLHTTP.5.0','Msxml2.XMLHTTP.4.0','Msxml2.XMLHTTP.3.0','Msxml2.XMLHTTP','Microsoft.XMLHTTP' );
	if ( window.XMLHttpRequest ) {request = new XMLHttpRequest;
	} else if ( window.ActiveXObject ) {
		for ( var i = 0; i < msxmlhttp.length; i ++ ) {
			try {
				request = new ActiveXObject( msxmlhttp[i] );
			} catch ( e ) {
				request = false;
			}
		}
	}
	if ( ! request ) {
		alert( 'Can\'t creare XMLHTTP instance :(' );
		return false;
	}
	request.onreadystatechange = function() {
		if ( request.readyState == 4 ) {
			if ( request.status == 200 ) {
				response = request.responseXML.documentElement;
				method = response.getElementsByTagName('method')[0].firstChild.data;
				result = response.getElementsByTagName('result')[0].firstChild.data;
				tagid  = response.getElementsByTagName('tagid')[0].firstChild.data;
				var i='document.getElementById(\'' + tagid + '\').' + method + '=' + result;
				//alert(i);
				eval(i);
			}
		}
	}
	request.open( "GET", url, true );
	request.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	request.send( null );
}


/*function d_load(url)
	{
	if(window.XMLHttpRequest)
		{//mozilla

		req=new XMLHttpRequest();
		req.open("GET", url, true);
		req.onreadystatechange=d_change;
		req.send(null);
		}
	else if (window.ActiveXObject)
			{//msie
			req= new ActiveXObject("Microsoft.XMLHTTP");
			if (req)
				{
				req.onreadystatechange=d_change;
				req.open("GET", url, true);
				req.send();
				}
			}
	}

function d_change()
	{
	if (req.readyState==4)
		{
			if (req.status==200)
				{
				response = req.responseXML.documentElement;
				method = response.getElementsByTagName('method')[0].firstChild.data;
				result = response.getElementsByTagName('result')[0].firstChild.data;
				tagid  = response.getElementsByTagName('tagid')[0].firstChild.data;
				var i='document.getElementById(\'' + tagid + '\').' + method + '=' + result;
				//alert(i);
				eval(i);
				}
			else
				{alert("Îøèáêà "+req.status);}
		}
	}  */

function show_video (video_key, site,curent){
	b=eval(video_template[site]);
	document.getElementById("main_video").innerHTML=b;
	var c = document.getElementById("cur");
	if (c.innerHTML != "")
	{
		document.getElementById(c.innerHTML).style.background = "none";
		document.getElementById(c.innerHTML).onmouseover = function(){this.style.background = '#f3f3f3'};
	    document.getElementById(c.innerHTML).onmouseout = function(){this.style.background = 'none'};
	}
	document.getElementById(curent).style.background = "#e6e6e6";
	c.innerHTML = curent;
}

var video_template= new Array();
video_template[1]='\'<object width="350" height="287"><param name="movie" value="http://www.youtube.com/v/\'+video_key+\'&hl=en&rel=0&color1=0x4C83C8&color2=0xDFE9F5&border=0"></param><param name="wmode" value="transparent"></param><embed src="http://www.youtube.com/v/\'+video_key+\'&hl=en&rel=0&color1=0x4C83C8&color2=0xDFE9F5&border=0" type="application/x-shockwave-flash" wmode="transparent" width="350" height="287"></embed></object>\'';
video_template[2]='\'<OBJECT width="350" height="309"><PARAM name="movie" value="http://video.rutube.ru/\'+video_key+\'"></PARAM><PARAM name="wmode" value="window"></PARAM><PARAM name="allowFullScreen" value="true"></PARAM><EMBED src="http://video.rutube.ru/\'+video_key+\'" type="application/x-shockwave-flash" wmode="window" width="350" height="309" allowFullScreen="true" ></EMBED></OBJECT>\'';
video_template[3]='\'<object width="350" height="288" id="fullscreen" align="middle" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,18,0" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"><param value="true" name="allowFullScreen"/><param name="wmode" value="transparent"><param value="http://play.ukr.net/player.swf?key=\'+video_key+\'" name="movie"/><embed wmode="transparent" width="350" height="288" align="middle" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="fullscreen" allowfullscreen="true" src="http://play.ukr.net/player.swf?key=\'+video_key+\'"/></object>\'';
video_template[4]='\'<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="350" height="289"><param name="movie" value="http://pics.smotri.com/scrubber_custom8.swf?file=\'+video_key+\'&bufferTime=3&autoStart=false&str_lang=eng&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color_lightblue.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml" /><param name="allowScriptAccess" value="always" /><param name="allowFullScreen" value="true" /><param name="bgcolor" value="#ffffff" /><embed src="http://pics.smotri.com/scrubber_custom8.swf?file=\'+video_key+\'&bufferTime=3&autoStart=false&str_lang=eng&xmlsource=http%3A%2F%2Fpics.smotri.com%2Fcskins%2Fblue%2Fskin_color_lightblue.xml&xmldatasource=http%3A%2F%2Fpics.smotri.com%2Fskin_ng.xml" quality="high" allowscriptaccess="always" allowfullscreen="true" wmode="window"  width="350" height="289" type="application/x-shockwave-flash"></embed></object>\'';
video_template[5]='\'<embed src="http://streams.topspeed.com/images/flash/flvplayer_article.swf" width="350" height="263" allowfullscreen="true" flashvars="file=http://streams.topspeed.com/bloc_flvplayer_playlist-doc\'+video_key+\'.xml&backcolor=0xFFFFFF&autostart=false&logo=http://pictures.topspeed.com/images/ts/_ts_watermark_150.png&link=http://www.topspeed.com&overstretch=true">\'';