﻿function Exception(name, message){
    if (name)
        this.name = name;
    if (message)
        this.message = message;
}
Exception.prototype.setName = function(name){
    this.name = name;
}
Exception.prototype.getName = function(){
    return this.name;
}
Exception.prototype.setMessage = function(msg){
    this.message = msg;
}
Exception.prototype.getMessage = function(){
    return this.message;
}
function FlashTag(src, width, height){
    this.src       = src;
    this.width     = width;
    this.height    = height;
    this.version   = '7,0,14,0';
    this.flashVars = null;
	 this.menu				='false';
    //this.id        = null;
    this.bgcolor   = '';
    this.id        = "f_" + ((new Date()).getTime()).toString();//modify by kindy lin at 060523
    this.salign = null;//modify by kindy lin at 060523
    this.scale = null;//modify by kindy lin at 060523
    this.wmode = 'transparent';//modify by kindy lin at 060523
    this.wmodeFF = null;//(FF=firefox)modify by kindy lin at 060523
}
//modify by kindy lin at 060523
FlashTag.prototype.setSalign = function(sa){
    this.salign = sa;
}

FlashTag.prototype.setMenu = function(menuShow){
    this.menu = menuShow;
}

FlashTag.prototype.setScale = function(scl){
    this.scale = scl;
}

FlashTag.prototype.setWmode = function(wm){
    this.wmode = wm;
}

FlashTag.prototype.setWmodeFF = function(wmff){
    this.wmodeFF = wmff
}
//end... modify by kindy lin at 060523

FlashTag.prototype.setVersion = function(v){
    this.version = v;
}

FlashTag.prototype.setId = function(id){
    this.id = id;
}

FlashTag.prototype.setBgcolor = function(bgc){
    this.bgcolor = bgc;
}

FlashTag.prototype.setFlashvars = function(fv){
    this.flashVars = fv;
}
//add by kindy lin at 060523
FlashTag.prototype.setSrc = function(src){
    this.src       = src;
}
FlashTag.prototype.setNew = function(src, width, height){
    this.src       = src;
    this.id        = "f_" + ((new Date()).getTime()).toString();
    this.width     = width;
    this.height    = height;
    this.flashVars = null;
    this.bgcolor   = '';
    this.salign = null;//modify by kindy lin at 060523
    this.scale = null;//modify by kindy lin at 060523
    this.wmode = 'transparent';//modify by kindy lin at 060523
    this.wmodeFF = null;//(FF=firefox)modify by kindy lin at 060523
}
//end...add by kindy lin at 060523
FlashTag.prototype.toString = function(){
    var ie = (navigator.appName.indexOf ("Microsoft") != -1) ? 1 : 0;
    var flashTag = new String();
    if (ie)
    {
        flashTag += '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" ';
        if (this.id != null)
        {
            flashTag += 'id="'+this.id+'" ';
        }
        flashTag += 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+this.version+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'">';
        flashTag += '<param name="movie" value="'+this.src+'"/>';
        flashTag += '<param name="quality" value="high"/>';
        flashTag += '<param name="bgcolor" value="#'+this.bgcolor+'"/>';
				flashTag += '<param name="menu" value="'+this.menu+'"/>';
        if (this.wmode != null)
        {
            flashTag += '<param name="wmode" value="'+this.wmode+'"/>';
        }
        if (this.salign != null)
        {
            flashTag += '<param name="salign" value="'+this.salign+'"/>';
        }
        if (this.scale != null)
        {
            flashTag += '<param name="scale" value="'+this.scale+'"/>';
        }
        if (this.flashVars != null)
        {
            flashTag += '<param name="flashvars" value="'+this.flashVars+'"/>';
        }
        flashTag += '</object>';
    }
    else
    {
        flashTag += '<embed src="'+this.src+'" ';
        flashTag += 'quality="high" '; 
        flashTag += 'bgcolor="#'+this.bgcolor+'" ';
        flashTag += 'width="'+this.width+'" ';
        flashTag += 'height="'+this.height+'" ';
        flashTag += 'type="application/x-shockwave-flash" ';
		  flashTag += 'menu="'+this.menu+'" ';
        if (this.flashVars != null)
        {
            flashTag += 'flashvars="'+this.flashVars+'" ';
        }
        if (this.id != null)
        {
            flashTag += 'name="'+this.id+'" ';
        }
				if ((this.wmode!=null)&&(this.wmode == "transparent")) {this.wmodeFF = "transparent"; }
        if (this.wmodeFF != null)
        {
            flashTag += 'wmode="'+this.wmodeFF+'" ';
        }
        if (this.scale != null)
        {
            flashTag += 'scale="'+this.scale+'" ';
        }
        if (this.salign != null)
        {
            flashTag += 'salign="'+this.salign+'" ';
        }        flashTag += 'pluginspage="http://www.macromedia.com/go/getflashplayer">';
        flashTag += '</embed>';
    }
    return flashTag;
}

FlashTag.prototype.write = function(doc){
    //doc.write(this.toString());
	if(doc.getElementById("syflash")!=null)doc.getElementById("syflash").innerHTML = this.toString();
}
function FlashSerializer(useCdata){
    this.useCdata = useCdata;
}
FlashSerializer.prototype.serialize = function(args){
    var qs = new String();

    for (var i = 0; i < args.length; ++i)
    {
        switch(typeof(args[i]))
        {
            case 'undefined':
                qs += 't'+(i)+'=undf';
                break;
            case 'string':
                qs += 't'+(i)+'=str&d'+(i)+'='+escape(args[i]);
                break;
            case 'number':
                qs += 't'+(i)+'=num&d'+(i)+'='+escape(args[i]);
                break;
            case 'boolean':
                qs += 't'+(i)+'=bool&d'+(i)+'='+escape(args[i]);
                break;
            case 'object':
                if (args[i] == null)
                {
                    qs += 't'+(i)+'=null';
                }
                else if (args[i] instanceof Date)
                {
                    qs += 't'+(i)+'=date&d'+(i)+'='+escape(args[i].getTime());
                }
                else // array or object
                {
                    try
                    {
                        qs += 't'+(i)+'=xser&d'+(i)+'='+escape(this._serializeXML(args[i]));
                    }
                    catch (exception)
                    {
                        throw new Exception("FlashSerializationException",
                                            "The following error occurred during complex object serialization: " + exception.getMessage());
                    }
                }
                break;
            default:
                throw new Exception("FlashSerializationException",
                                    "You can only serialize strings, numbers, booleans, dates, objects, arrays, nulls, and undefined.");
        }

        if (i != (args.length - 1))
        {
            qs += '&';
        }
    }

    return qs;
}

FlashSerializer.prototype._serializeXML = function(obj){
    var doc = new Object();
    doc.xml = '<fp>'; 
    this._serializeNode(obj, doc, null);
    doc.xml += '</fp>'; 
    return doc.xml;
}

FlashSerializer.prototype._serializeNode = function(obj, doc, name){
    switch(typeof(obj))
    {
        case 'undefined':
            doc.xml += '<undf'+this._addName(name)+'/>';
            break;
        case 'string':
            doc.xml += '<str'+this._addName(name)+'>'+this._escapeXml(obj)+'</str>';
            break;
        case 'number':
            doc.xml += '<num'+this._addName(name)+'>'+obj+'</num>';
            break;
        case 'boolean':
            doc.xml += '<bool'+this._addName(name)+' val="'+obj+'"/>';
            break;
        case 'object':
            if (obj == null)
            {
                doc.xml += '<null'+this._addName(name)+'/>';
            }
            else if (obj instanceof Date)
            {
                doc.xml += '<date'+this._addName(name)+'>'+obj.getTime()+'</date>';
            }
            else if (obj instanceof Array)
            {
                doc.xml += '<array'+this._addName(name)+'>';
                for (var i = 0; i < obj.length; ++i)
                {
                    this._serializeNode(obj[i], doc, null);
                }
                doc.xml += '</array>';
            }
            else
            {
                doc.xml += '<obj'+this._addName(name)+'>';
                for (var n in obj)
                {
                    if (typeof(obj[n]) == 'function')
                        continue;
                    this._serializeNode(obj[n], doc, n);
                }
                doc.xml += '</obj>';
            }
            break;
        default:
            throw new Exception("FlashSerializationException",
                                "You can only serialize strings, numbers, booleans, objects, dates, arrays, nulls and undefined");
            break;
    }
}

FlashSerializer.prototype._addName= function(name){
    if (name != null){
        return ' name="'+name+'"';
    }
    return '';
}

FlashSerializer.prototype._escapeXml = function(str){
    if (this.useCdata)
        return '<![CDATA['+str+']]>';
    else
        return str.replace(/&/g,'&amp;').replace(/</g,'&lt;');
}

function FlashProxy(uid, proxySwfName){
    this.uid = uid;
    this.proxySwfName = proxySwfName;
    this.flashSerializer = new FlashSerializer(false);
}

FlashProxy.prototype.call = function(){
    if (arguments.length == 0)
    {
        throw new Exception("Flash Proxy Exception",
                            "The first argument should be the function name followed by any number of additional arguments.");
    }

    var qs = 'lcId=' + escape(this.uid) + '&functionName=' + escape(arguments[0]);

    if (arguments.length > 1)
    {
        var justArgs = new Array();
        for (var i = 1; i < arguments.length; ++i)
        {
            justArgs.push(arguments[i]);
        }
        qs += ('&' + this.flashSerializer.serialize(justArgs));
    }

    var divName = '_flash_proxy_' + this.uid;
    if(!document.getElementById(divName))
    {
        var newTarget = document.createElement("div");
        newTarget.id = divName;
        document.body.appendChild(newTarget);
    }
    var target = document.getElementById(divName);
    var ft = new FlashTag(this.proxySwfName, 1, 1);
    ft.setVersion('6,0,65,0');
    ft.setFlashvars(qs);
    target.innerHTML = ft.toString();
}

FlashProxy.callJS = function(){
    var functionToCall = eval(arguments[0]);
    var argArray = new Array();
    for (var i = 1; i < arguments.length; ++i)
    {
        argArray.push(arguments[i]);
    }
    functionToCall.apply(functionToCall, argArray);
}
/*i add this (kindy)*/
function getMovieObj(movieName) {
		if (navigator.appName.indexOf("Microsoft") != -1){
			return window[movieName];
		}else{
			return document[movieName];
		}
}
var flashTagIns = new FlashTag("", 100, 10);//add by kindy lin at 060523
flashTagIns.setNew("http://www.51fund.com/images/tl_banner.swf?varsUrl=http://www.51fund.com/sy/flash/index.htm", 760, 140);
flashTagIns.setVersion("7,0,19,0");
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
//打开友情链接
function selectlink(linkOption){if (linkOption.value==""){alert("请选择友情链接站点！");return false;}else{window.open(linkOption.value,"","");return true;}}
function changejj(str){
	document.getElementById("gpx").style.display = "none";
	document.getElementById("hhx").style.display = "none";
	document.getElementById("qdx").style.display = "none";
	document.getElementById("zqx").style.display = "none";
	document.getElementById("hbx").style.display = "none";
	document.getElementById("gpxtab").className = "indexjz";
	document.getElementById("hhxtab").className = "indexjz";
	document.getElementById("zqxtab").className = "indexjz";
	document.getElementById("qdxtab").className = "indexjz";
	document.getElementById("hbxtab").className = "indexjz";
	if(str == "hbx"){
		document.getElementById("hbxtitle").style.display = "";
		document.getElementById("fhbxtitle").style.display = "none";
	}else{
		document.getElementById("hbxtitle").style.display = "none";
		document.getElementById("fhbxtitle").style.display = "";
	}
	document.getElementById(str+"tab").className = "indexjzactive";
	document.getElementById(str).style.display = "";
}
function GetDIV(e,obj,sss){
	e=e||event;
	document.getElementById("div"+sss).style.display=obj;
	document.getElementById("div"+sss).style.top=e.clientY+0+document.documentElement.scrollTop+"px";
	document.getElementById("div"+sss).style.left=e.clientX+10+document.documentElement.scrollLeft+"px";
}
function getRiseFallStyle(data){if(data!=null&&data!="")return data.substring(0,1)=="-" ? "btnGlobalGreen":"btnGlobalRed";else return "";}
//生成xmlDom
function getXmlDom(strXML) {
	var xmlDom;
	try {
		if (window.ActiveXObject) { //IE
			xmlDom = new ActiveXObject("Microsoft.XMLDOM");
			if(!xmlDom) xmlDom = new ActiveXObject("MSXML2.DOMDocument.3.0");
			xmlDom.loadXML(strXML);
			return xmlDom;
		}else if(window.XMLHttpRequest) { //FF
			var oParser = new DOMParser();
			xmlDom = oParser.parseFromString(strXML,"text/xml");
			if (xmlDom.documentElement.tagName == "parsererror") {
				var oSerializer = new XMLSerializer();
				alert("An error occurred:\n错误代码: " + oSerializer.serializeToString(oXmlDom.documentElement));
			}else {
				return xmlDom;
			}
		}
	} catch(e){}
}
//载入净值
function loadNetValue(){
	try{
		var data = getXmlDom(strXML);
		var funds = data.getElementsByTagName("Fund");
		for(var i=0;i<funds.length;i++){
			var item = funds.item(i);
			var fundCode = item.getElementsByTagName("Fund-Code")[0].childNodes[0].nodeValue;
			var fundName = item.getElementsByTagName("Fund-Name")[0].childNodes[0].nodeValue;
			var netValue = item.getElementsByTagName("Net-Value")[0].childNodes[0].nodeValue;
			var totalNetValue = item.getElementsByTagName("Total-Net-Value")[0].childNodes[0].nodeValue;
			var lately7Waver = "";
			if(item.getElementsByTagName("Lately7-Waver")[0].childNodes[0]!=null)
				lately7Waver = item.getElementsByTagName("Lately7-Waver")[0].childNodes[0].nodeValue;//货币基金七日7日年化收益率
			var fundDate = item.getElementsByTagName("Fund-Date")[0].childNodes[0].nodeValue;
			if(fundName == "上投货币" || fundName == "上投货币A" || fundName == "上投货币B"){
				var preMyriadYield = item.getElementsByTagName("PreMyriad-Yield")[0].childNodes[0].nodeValue;//货币基金每万份收益
				if(document.getElementById(fundName + "-lately7Waver") != null)
					document.getElementById(fundName + "-lately7Waver").innerHTML = lately7Waver;
				if(document.getElementById(fundName + "-preMyriadYield") != null)
					document.getElementById(fundName + "-preMyriadYield").innerHTML = preMyriadYield;
				if(document.getElementById(fundName + "-fundState") != null)
					document.getElementById(fundName + "-fundState").innerHTML = "正常开放";
				if(document.getElementById(fundName + "-fundDate") != null)
					document.getElementById(fundName + "-fundDate").innerHTML = fundDate;
				if(document.getElementById("snet_"+fundCode) != null)
					document.getElementById("snet_"+fundCode).innerHTML = "每万份收益:"+preMyriadYield+"<br>7日收益率:"+lately7Waver+"<br>净值日期:"+fundDate.substring(5);
				if(document.getElementById("dnet_"+fundCode) != null)
					document.getElementById("dnet_"+fundCode).innerHTML = "每万份收益:"+preMyriadYield+"<br>7日收益率:"+lately7Waver+"<br>净值日期:"+fundDate.substring(5);
			}else{
				var todayWaver = "---";
				if(item.getElementsByTagName("Today-Waver")[0].childNodes[0]!=null)todayWaver=item.getElementsByTagName("Today-Waver")[0].childNodes[0].nodeValue;
				//if(fundName=="强化回报A" || fundName=="强化回报B" || fundName=="新兴动力")todayWaver = "---";
				var fundState = item.getElementsByTagName("Fund-State")[0].childNodes[0].nodeValue;
				if(document.getElementById(fundName + "-netValue") != null)
					document.getElementById(fundName + "-netValue").innerHTML = netValue;
				if(document.getElementById(fundName + "-totalNetValue") != null)
					document.getElementById(fundName + "-totalNetValue").innerHTML = totalNetValue;
				if(document.getElementById(fundName + "-fundDate") != null)
					document.getElementById(fundName + "-fundDate").innerHTML = fundDate;
				if(document.getElementById(fundName + "-todayWaver") != null){
					document.getElementById(fundName + "-todayWaver").innerHTML = todayWaver;
					document.getElementById(fundName + "-todayWaver").setAttribute("class", getRiseFallStyle(todayWaver));
					document.getElementById(fundName + "-todayWaver").setAttribute("className", getRiseFallStyle(todayWaver));
				}
				if(document.getElementById(fundName + "-fundState") != null)
					document.getElementById(fundName + "-fundState").innerHTML = fundState;
				if(document.getElementById("snet_"+fundCode) != null)
					document.getElementById("snet_"+fundCode).innerHTML = "最新净值:"+netValue+"<br>累计净值:"+totalNetValue+"<br>净值日期:"+fundDate.substring(5);
				if(document.getElementById("dnet_"+fundCode) != null)
					document.getElementById("dnet_"+fundCode).innerHTML = "最新净值:"+netValue+"<br>累计净值:"+totalNetValue+"<br>净值日期:"+fundDate.substring(5);
			}
		}
	}catch(e){}
}
function showcurcity(){
	var xmlDoc;
	if (window.ActiveXObject) { //IE
		xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
		xmlDoc.async = "false"   
		xmlDoc.load("/images/fundphb1.xml");
		var series = xmlDoc.getElementsByTagName("value");
		for(var i=2;i>=0;i--){	
			document.getElementById("phbname_"+i).innerHTML = series.item(i).text;
			document.getElementById("phbpic_"+i).width = (series.item(i+3).text) / (Math.floor((series.item(5).text)/76));
			document.getElementById("snet"+i).id = "snet_" + series.item(i).getAttribute("xid");
		}
		xmlDoc.load("/images/fundphb2.xml");
		series = xmlDoc.getElementsByTagName("value");
		for(var i=2;i>=0;i--){	
			document.getElementById("dtphbname_"+i).innerHTML = series.item(i).text;
			document.getElementById("dtphbpic_"+i).width = (series.item(i+3).text) / (Math.floor((series.item(5).text)/76));
			document.getElementById("dnet"+i).id = "dnet_" + series.item(i).getAttribute("xid");
		}
	}else if(document.implementation && document.implementation.createDocument){
		var xmlhttp = new window.XMLHttpRequest();
		xmlhttp.open("GET","/images/fundphb1.xml",false);
		xmlhttp.send(null);
		xmlDoc = xmlhttp.responseXML.documentElement;
		var series = xmlDoc.getElementsByTagName("value");
		for(var i=2;i>=0;i--){
			document.getElementById("phbname_"+i).innerHTML = series[i].childNodes[0].nodeValue;
			document.getElementById("phbpic_"+i).width = (series[i+3].childNodes[0].nodeValue) / (Math.floor((series[5].childNodes[0].nodeValue)/76));
			document.getElementById("snet"+i).id = "snet_" + series[i].getAttribute("xid");
		}
		xmlhttp.open("GET","/images/fundphb2.xml",false);
		xmlhttp.send(null);
		xmlDoc = xmlhttp.responseXML.documentElement;
		var series1 = xmlDoc.getElementsByTagName("value");
		for(var i=2;i>=0;i--){
			document.getElementById("dtphbname_"+i).innerHTML = series1[i].childNodes[0].nodeValue;
			document.getElementById("dtphbpic_"+i).width = (series1[i+3].childNodes[0].nodeValue) / (Math.floor((series1[5].childNodes[0].nodeValue)/76));
			document.getElementById("dnet"+i).id = "dnet_" + series1[i].getAttribute("xid");
		}
	}else{
		return null;
	}
}
//sajax.js  begin
var SAjax_TimeHander = new Array();
function  SAjax(url,CheckFlag,success,onerror,interval,testcount,catched){
	this.success =	success;		
	this.CheckFlag = CheckFlag;
	this.url = url;
	this.onError = onerror;
	this.interval = (typeof(interval)=="number")?interval:300;
	this.testcount = (typeof(testcount)=="number")?testcount:25;
	this.getdata = _getContent;
	this.catched = (typeof(catched)=="boolean")?catched:false;
	this.getdata();
}
function _getContent(){
	if(this.CheckFlag == "") alert("检测值为空");
	if(this.url == "") alert("url为空"); 
	var timerId = SAjax_TimeHander.length;
	var scriptid = "script_"+timerId; 
	var script = document.createElement("script"); 
		script.type ="text/javascript";
		script.id =scriptid;
		script.src= this.url;
	if(!this.catched){
		var clear = "var s ; "+this.CheckFlag + " =s;"; 
		eval(clear);
	}
	document.getElementsByTagName("head")[0].appendChild(script);
	if ( eval("  typeof("+this.CheckFlag+") == \"undefined\" ")){
		SAjax_TimeHander[timerId] = new Array();
		SAjax_TimeHander[timerId][0] = 
		window.setInterval("SAjax_stop('"+timerId+"','"+this.CheckFlag+"','"+this.testcount+"','"+scriptid+"')", this.interval);
		SAjax_TimeHander[timerId][1] = 0; 
		SAjax_TimeHander[timerId][2] = this;
	}else{
		this.success();
	}
}
function SAjax_stop(timerId,CheckFlag,testcount,scriptid){ 
	if (eval("  typeof("+CheckFlag+") == \"undefined\" ") == false)

	{	
		window.clearInterval(SAjax_TimeHander[timerId][0]);
		if(typeof(SAjax_TimeHander[timerId][2].success) == "function")
			SAjax_TimeHander[timerId][2].success(); 
		var script = document.getElementById(scriptid);
		script.parentNode.removeChild(script); 
	}else{
		SAjax_TimeHander[timerId][1]++;
		if (SAjax_TimeHander[timerId][1] >testcount){
			window.clearInterval(SAjax_TimeHander[timerId][0]);
			SAjax_TimeHander[timerId][1] = 0;
			SAjax_error(timerId); 				
			var script = document.getElementById(scriptid);
			script.parentNode.removeChild(script); 
		}
	}
}
function SAjax_error( timerId){
	if(typeof(SAjax_TimeHander[timerId][2].onError) == "function")
		SAjax_TimeHander[timerId][2].onError();
}
function getDivContent(url){
	new SAjax(url, 
	"loginUser",
	function (){dowork();},
	function (){
		var lun = document.getElementById("loginUserW");
		lun.innerHTML ="您好！[<a href='https://equery.51fund.com/equery/index.jsp' target='_top'>请登录</a>]&nbsp;[<a href='https://id.51fund.com/ids/custom/rega.jsp'  target='_top'>注册</a>]" ;
	},500);
}
function dowork(){
	if (typeof(loginUser) != "undefined"){
		var lun = document.getElementById("loginUserW");
		if(loginUser =="" )
			lun.innerHTML ="您好！[<a href='https://equery.51fund.com/equery/index.jsp' target='_top'>请登录</a>]&nbsp;[<a href='https://id.51fund.com/ids/custom/rega.jsp' target='_blank'>注册</a>]" ;
		else
			lun.innerHTML ="您好，"+ loginUser+"！[<a href='https://equery.51fund.com/equery/index.jsp' target=\"_top\">我的专区</a>]&nbsp;[<a href='https://myspace.51fund.com/myspace/loginOut.jsp' target='_top'>退出</a>]" ;
	}
}
//----sajax end
//---右下角悬浮 begin
window.onresize = resizeDiv; 
window.onerror = function(){} 
//短信提示使用(asilas添加) 
var divTop,divLeft,divWidth,divHeight,docHeight,docWidth,objTimer,i = 0; 
function getMsg(){ 
	try{ 
		divTop = parseInt(document.getElementById("eMeng").style.top,10) 
		divLeft = parseInt(document.getElementById("eMeng").style.left,10) 
		divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10) 
		divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10) 
		docWidth = document.documentElement.clientWidth; 
		docHeight = document.documentElement.clientHeight; 
		document.getElementById("eMeng").style.top = parseInt(document.documentElement.scrollTop,10) + docHeight + 10 + "px";// divHeight 
		document.getElementById("eMeng").style.left = parseInt(document.documentElement.scrollLeft,10) + docWidth - divWidth + "px";
		document.getElementById("eMeng").style.visibility="visible" 
		objTimer = window.setInterval("moveDiv()",10) 
	}catch(e){} 
} 
function resizeDiv(){ 
	i+=1 
	if(i>500) closeDiv() 
	try{ 
		divHeight = parseInt(document.getElementById("eMeng").offsetHeight,10) 
		divWidth = parseInt(document.getElementById("eMeng").offsetWidth,10) 
		docWidth = document.documentElement.clientWidth; 
		docHeight = document.documentElement.clientHeight; 
		document.getElementById("eMeng").style.top = docHeight - divHeight + parseInt(document.documentElement.scrollTop,10) + "px";
		document.getElementById("eMeng").style.left = docWidth - divWidth + parseInt(document.documentElement.scrollLeft,10) + "px";
	}catch(e){} 
} 
function moveDiv(){ 
	try{ 
		if(parseInt(document.getElementById("eMeng").style.top,10) <= (docHeight - divHeight + parseInt(document.documentElement.scrollTop,10))){ 
			window.clearInterval(objTimer) 
		objTimer = window.setInterval("resizeDiv()",1) 
		} 
		divTop = parseInt(document.getElementById("eMeng").style.top,10) 
		document.getElementById("eMeng").style.top = divTop - 1 + "px";
	}catch(e){} 
}

function closeDiv(){ 
	document.getElementById('eMeng').style.visibility='hidden'; 
	if(objTimer) window.clearInterval(objTimer) 
}
function setHomePage(){if(document.all){document.body.style.behavior='url(#default#homepage)';document.body.setHomePage('http://www.51fund.com');}else if (window.sidebar){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect');}catch(e){alert( '该操作被浏览器拒绝，如果想启用该功能，请在地址栏内输入 about:config,然后将项 signed.applets.codebase_principal_support 值该为true');}} var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components. interfaces.nsIPrefBranch);prefs.setCharPref('browser.startup.homepage','http://www.51fund.com');}}
//---右下角悬浮 end

function changeHQ(t){
	if(t==1)document.getElementById("HQ_PIC").src = "http://222.73.46.142/dfpic/dfpic.dll?minute?zqdm=000001.sh&width=148&height=130&percent=0";
	if(t==2)document.getElementById("HQ_PIC").src = "http://222.73.46.142/dfpic/dfpic.dll?minute?zqdm=399001.sz&width=148&height=130&percent=0";
	if(t==3)document.getElementById("HQ_PIC").src = "http://222.73.46.142/dfpic/dfpic.dll?minute?zqdm=000011.sh&width=148&height=130&percent=0";
	document.getElementById("zzt_item1").className="pub_05_ot_tab";
	document.getElementById("zzt_item2").className="pub_05_ot_tab";
	document.getElementById("zzt_item3").className="pub_05_ot_tab";
	document.getElementById("zzt_item"+t).className="pub_05_cur_tab";
}

//----实时播报---
// 关闭ifeng_go
function ifeng_go_close() {
	document.getElementById('ifengGo').style.display = 'none';
}
// ifeng_go用的滚动效果
function ifengGo_ScrollText(content,btnPrevious,btnNext,autoStart,timeout,isSmoothScroll) {
	this.Speed=10;
	this.Timeout=timeout;
	this.stopscroll=false;
	this.isSmoothScroll=isSmoothScroll;
	this.LineHeight=20;
	this.NextButton=this.$(btnNext);
	this.PreviousButton=this.$(btnPrevious);
	this.ScrollContent=this.$(content);
	this.ScrollContent.innerHTML+=this.ScrollContent.innerHTML;
	if(this.PreviousButton) {
		this.PreviousButton.onclick=this.GetFunction(this,"Previous");
		this.PreviousButton.onmouseover=this.GetFunction(this,"MouseOver");
		this.PreviousButton.onmouseout=this.GetFunction(this,"MouseOut");
	}
	if(this.NextButton) {
		this.NextButton.onclick=this.GetFunction(this,"Next");
		this.NextButton.onmouseover=this.GetFunction(this,"MouseOver");
		this.NextButton.onmouseout=this.GetFunction(this,"MouseOut");
	}
	this.ScrollContent.onmouseover=this.GetFunction(this,"MouseOver");
	this.ScrollContent.onmouseout=this.GetFunction(this,"MouseOut");
	if(autoStart) {
		this.Start();
	}
}
ifengGo_ScrollText.prototype={
	$: function (element) {
		return document.getElementById(element);
	},
	Previous: function () {
		this.stopscroll=true;
		this.Scroll("up");
	},
	Next: function () {
		this.stopscroll=true;
		this.Scroll("down");
	},
	Start: function () {
		if(this.isSmoothScroll) {
			this.AutoScrollTimer=setInterval(this.GetFunction(this,"SmoothScroll"),this.Timeout);
		} else {
			this.AutoScrollTimer=setInterval(this.GetFunction(this,"AutoScroll"),this.Timeout);
		}
	},
	Stop: function () {
		clearTimeout(this.AutoScrollTimer);
		this.DelayTimerStop=0;
	},
	MouseOver: function () {
		this.stopscroll=true;
	},
	MouseOut: function () {
		this.stopscroll=false;
	},
	AutoScroll: function () {
		if(this.stopscroll) {
			return;
		}
		this.ScrollContent.scrollTop++;
		if(parseInt(this.ScrollContent.scrollTop)%this.LineHeight!=0) {
			this.ScrollTimer=setTimeout(this.GetFunction(this,"AutoScroll"),this.Speed);
		} else {
			if(parseInt(this.ScrollContent.scrollTop)>=parseInt(this.ScrollContent.scrollHeight)/2) {
				this.ScrollContent.scrollTop=0;
			}
			clearTimeout(this.ScrollTimer);
		}
	},
	SmoothScroll: function () {
		if(this.stopscroll) {
			return;
		}
		this.ScrollContent.scrollTop++;
		if(parseInt(this.ScrollContent.scrollTop)>=parseInt(this.ScrollContent.scrollHeight)/2) {
			this.ScrollContent.scrollTop=0;
		}
	},
	Scroll: function (direction) {
		if(direction=="up") {
			this.ScrollContent.scrollTop--;
		} else {
			this.ScrollContent.scrollTop++;
		}
		if(parseInt(this.ScrollContent.scrollTop)>=parseInt(this.ScrollContent.scrollHeight)/2) {
			this.ScrollContent.scrollTop=0;
		} else if(parseInt(this.ScrollContent.scrollTop)<=0) {
			this.ScrollContent.scrollTop=parseInt(this.ScrollContent.scrollHeight)/2;
		}
		if(parseInt(this.ScrollContent.scrollTop)%this.LineHeight!=0) {
			this.ScrollTimer=setTimeout(this.GetFunction(this,"Scroll",direction),this.Speed);
		}
	},
	GetFunction: function (variable,method,param) {
		return function () {
			variable[method](param);
		}
	}
}
function fenggo_2010yayun_news(id) {
	var data = _ifenggo_2010yayun_news.item;
	var html = '';
	for(var i = 0; i < data.length; i++) {
		html += '<li>'
		html += '<a href="' + data[i].link + '" target="_blank">' + decodeURI(data[i].title) + ' </a>';
		html += '</li>';
	}
	document.getElementById(id).innerHTML = html;
}
