
function ShowFlash(sfilename, iwidth, iheight)	
{
	var _showflash = '';

	_showflash = '<object classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 codebase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0 width='+ iwidth +' height='+ iheight +'>';
	_showflash = _showflash + '<param name=movie value='+ sfilename +'>';
	_showflash = _showflash + '<param name=allowScriptAccess value=always>';
	_showflash = _showflash + '<param name=wmode value=transparent>';
	_showflash = _showflash + '<param name=quality value=high>';
	_showflash = _showflash + '<embed src='+ sfilename +' quality=high pluginspage=http://www.macromedia.com/go/getflashplayer type=application/x-shockwave-flash allowscriptaccess=always swliveconnect=true width='+ iwidth +' height='+ iheight +'></embed></object>';
  
    document.write(_showflash);
}



function ShowVod(sfilename, iwidth, ihegiht)
{
	var _showvod = '';

	_showvod = '<object id=mediaplayer classid=clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95 codebase=http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#version=5,1,52,701 standby=loading microsoft windows media player components... type=application/x-oleobject width='+ iwidth +' height='+ ihegiht +'>'
	_showvod = _showvod + '<param name=filename value='+ sfilename +'>'
	_showvod = _showvod + '<param name=animationatstart value=true>'
	_showvod = _showvod + '<param name=transparentatstart value=true>'
	_showvod = _showvod + '<param name=autostart value=true>'
	_showvod = _showvod + '<param name=showcontrols value=true>'
	_showvod = _showvod + '<param name=width value='+ iwidth +'>'
	_showvod = _showvod + '<param name=height value='+ ihegiht +'>'
	_showvod = _showvod + '</object>'

	document.write(_showvod);
}

var t = 0;
var ox = 10;	//offset x
var oy = -10;	//offset y

function resetTimer(){
	clearTimeout(t);
}
function show_dialog(x,y){
	construct_dialog();
	var keydia = document.getElementById("keydia");
	keydia.style.top = y;
	keydia.style.left = x;
	keydia.style.visibility = "";
}
function hide_dialog(){
	var keydia = document.getElementById("keydia");
	keydia.style.visibility = "hidden";
	if (keydia != null)
	{
			keydia.style.visibility = "hidden";
	}
	var con = document.getElementById("ad_container");
	con.innerHTML = "";
}
function delay_display_other(e){
	var c = getPosition_other(e);
	var x=c.x+ox;
	var y = c.y+oy;
	var cmd = "show_dialog('"+x+"px"+"','"+y+"px')";
	t = setTimeout(cmd,300);
}
function delay_hide_other(e){
	var cmd = "hide_dialog()";
	t = setTimeout(cmd,500);
}
function construct_dialog(){
	var con = document.getElementById("ad_container");
	con.innerHTML = "<div id=\"keydia\" style=\"border: 1px solid #000000;position: absolute;visibility:hidden;z-index: auto;height: 128px;width: 320px;left: 117px;top: 13px;background-color:#ffffff\" onMouseOver=\"javascript:resetTimer();\" onMouseOut=\"javascript:delay_hide_other(event);\"><table cellspacing=\"5\" ><tr><td bgcolor=#3C97C4  style=\"font-size:9pt;color:white;font-weight:bold;padding-top:4px;\">&nbsp;正版</td></tr><tr><td style=\"font-size:9pt;font-family:Arial;\">正版 Windows 是得到正确授权并合法安装的真品 Windows 软件。Microsoft 为使用正版 Windows 产品的客户预留了特殊好处，要了解相关详细信息，请访问 <a href=\"http://www.microsoft.com/genuine\" target='_blank'>www.microsoft.com/genuine</a>。</font></rd></tr></table><div style=\"clear:both;\"></div></div>";
}
function getPosition_other(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
		//alert(cursor.x+" "+cursor.y+" "+screen.availHeight+" "+screen.availWidth);
	if(screen.availWidth/2 < cursor.x){
		cursor.x  = cursor.x - 320;
	}
	cursor.x  = cursor.x - 40;
	if(screen.availHeight/2 < cursor.y){
		cursor.y  = cursor.y - 180;
	}

    return cursor;
}

