//if (!window.Element);
	//var Element = new Object();
var PrototypeQuote = 
{
  	Version: '1.5.0',
  	BrowserFeatures: 
  	{
    	XPath: !!document.evaluate
 	},
  	ScriptFragment: '(?:<script.*?>)((\n|\r|.)*?)(?:<\/script>)',
  	emptyFunction: function() {},
  	K: function(x) { return x }
}
function hasQuoteClassName(element, className)
{
    if (!(element = _$(element))) return;
    var elementClassName = element.className;
    if (elementClassName.length == 0) return false;
    if (elementClassName == className ||
        elementClassName.match(new RegExp("(^|\\s)" + className + "(\\s|$)")))
      return true;
    return false;
}
function _$(element) 
{
  	if (arguments.length > 1)
  	{
    	for (var i = 0, elements = [], length = arguments.length; i < length; i++)
      	elements.push(_$(arguments[i]));
    	return elements;
  	}
  	if (typeof element == 'string')
    	element = document.getElementById(element);
  	return element;
}
document._getQuoteElementsByXPath = function(expression, parentElement)
{
    var results = [];
    var query = document.evaluate(expression, _$(parentElement) || document,
      null, XPathResult.ORDERED_NODE_SNAPSHOT_TYPE, null);
    for (var i = 0, length = query.snapshotLength; i < length; i++)
      results.push(query.snapshotItem(i));
    return results;
};
document.getQuoteElementsByClassName = function(Name, parentElement) 
{
  	if (PrototypeQuote.BrowserFeatures.XPath) 
  	{
   		var q = ".//*[contains(concat(' ', @class, ' '), ' " + Name + " ')]";
   		return document._getQuoteElementsByXPath(q, parentElement);
  	} else 
  	{
	    var children = (_$(parentElement) || document.body).getElementsByTagName('*');
	    var elements = [], child;
	    for (var i = 0, length = children.length; i < length; i++) 
	    {
	      	child = children[i];	  
	    	if (hasQuoteClassName(child,Name))
        	elements.push(child);
    	}
    	return elements;
  	}
};
	function $import(path, type){
		if(!type)type="js";
		if (type == "css")
		{
			document.write("<" + "link href=\"" +  path + "\" rel=\"stylesheet\" type=\"text/css\"></" + "link>");
		} else {
			document.write("<" + "script src=\"" + path + "\"></" + "script>");
		}
	}
function _$$(objname)
{     
	  return document.getQuoteElementsByClassName(objname);
}
function setQuoteValue(elements,value)
{
	if(elements)
	{
	
		for(i=0;i<elements.length;i++)
		{
			elements[i].innerHTML=value;			
		}
	}
}
String.prototype.endWith=function(oString)
{  
  	var   reg=new   RegExp(oString+"$");  
  	return   reg.test(this);  
   
}
var QuoteData=
{
	"quoteElements":null,
	"mainElements":null,
	"maincode":null,
	"timer":null,
	"arrayPriceLast":null,
	"codes":"",
	"list":new Array(),
	"uImg":"<font color='red'>↑</font>",
	"dImg":"<font color='green'>↓</font>",
	"timeout":6000,
	"getQuoteElements":function()
	{
		this.quoteElements=_$$('_quote_');
		this.mainElements=_$$('_mainquote_');
	},
	"getColor":function(close,p)
	{
		if(p>close)
			return "red";
		else if(p<close)
			return "green";
		else return "black";
	},
	"fox":function(str)
	{
		
		var a=str.split(";");	
		var code=a[0];
		var _num=3;
		if(code.indexOf("060")==0 || code.indexOf("100")==0|| code.indexOf("0000100")==0|| code.indexOf("1399000")==0)_num=2;
		var price=a[10];
		if(price==0)price=a[2];
		var variable=price-a[2];
		if(variable>0)
		    	color="red"; 		 	
		else if(variable<0)color="green";		   		
		else color="black";
		
		if(!this.list[a[0]])this.list[a[0]]=new Array();
		this.list[a[0]]["name"]=a[1];
		this.list[a[0]]["previousclose"]=a[2];
		
		this.list[a[0]]["openprice"]="<font color="+this.getColor(a[2],a[3])+">"+(a[3]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["shareamount"]=(a[4]/10000).toFixed(0)+"万";
		this.list[a[0]]["shareamount1"]=(a[4]/100000000).toFixed(0);
		this.list[a[0]]["sharevolume"]=(a[5]/100).toFixed(0)+"手";
		this.list[a[0]]["sharevolume1"]=(a[5]/10000).toFixed(_num);
		this.list[a[0]]["sharecount"]=a[6];
		this.list[a[0]]["updown"]=a[7];
		this.list[a[0]]["todayhigh"]=(a[8]*1).toFixed(_num);
		this.list[a[0]]["todaylow"]=(a[9]*1).toFixed(_num);
		this.list[a[0]]["price"]=(a[10]*1).toFixed(_num);
		this.list[a[0]]["pe"]=a[11];
		
		this.list[a[0]]["buyprice1"]="<font color="+this.getColor(a[2],a[12])+">"+(a[12]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["buycount1"]=(a[13]/100).toFixed(0);
		this.list[a[0]]["buyprice2"]="<font color="+this.getColor(a[2],a[14])+">"+(a[14]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["buycount2"]=(a[15]/100).toFixed(0);
		this.list[a[0]]["buyprice3"]="<font color="+this.getColor(a[2],a[16])+">"+(a[16]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["buycount3"]=(a[17]/100).toFixed(0);
		this.list[a[0]]["buyprice4"]="<font color="+this.getColor(a[2],a[18])+">"+(a[18]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["buycount4"]=(a[19]/100).toFixed(0);
		this.list[a[0]]["buyprice5"]="<font color="+this.getColor(a[2],a[20])+">"+(a[20]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["buycount5"]=(a[21]/100).toFixed(0);
		this.list[a[0]]["sellprice1"]="<font color="+this.getColor(a[2],a[22])+">"+(a[22]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["sellcount1"]=(a[23]/100).toFixed(0);
		this.list[a[0]]["sellprice2"]="<font color="+this.getColor(a[2],a[24])+">"+(a[24]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["sellcount2"]=(a[25]/100).toFixed(0);
		this.list[a[0]]["sellprice3"]="<font color="+this.getColor(a[2],a[26])+">"+(a[26]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["sellcount3"]=(a[27]/100).toFixed(0);
		this.list[a[0]]["sellprice4"]="<font color="+this.getColor(a[2],a[28])+">"+(a[28]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["sellcount4"]=(a[29]/100).toFixed(0);
		this.list[a[0]]["sellprice5"]="<font color="+this.getColor(a[2],a[30])+">"+(a[30]*1).toFixed(_num)+"</font>";
		this.list[a[0]]["sellcount5"]=(a[31]/100).toFixed(0);
		this.list[a[0]]["time"]=a[32];
		var avg=(a[4]/a[5]).toFixed(2);
		this.list[a[0]]["avg"]=avg;
	},
	"addMain":function(code)
	{
		this.maincode=code;
		if(this.maincode&&this.maincode.length==7)
		{
			this.add(this.maincode);
		}
	},
	"add":function(code)
	{
		if(code&&code.length>0)
		{
			var a=code.split(",");
			if(a)
			{
				for(var i=0;i<a.length;i++)
				{
					if(this.codes.indexOf(a[i]+";")>-1)
						continue;
					if(this.codes&&this.codes.length>0&& (!this.codes.endWith(";")))
						this.codes+=";"						
					this.codes+=a[i]+";";
				}
			}
		}		
	},
	"show_quote":function()
	{	
		if(!this.codes||this.codes.length==0)
			return;
		var code=new Array();
		if(this.codes.endWith(";"))
		{
     		this.codes.substring(0,this.codes.length-1);
		}
		code=this.codes.split(";");
		var l=code.length;
		if(this.arrayPriceLast&&this.arrayPriceLast.length>0)
		{
		}
		arrayPrice=new Array();
		for(var i=0;i<l;i++)
		{
		
		  	var a;
			try{
				a=eval("quote_"+code[i]);
			}catch(e){			
				continue;}		
		  	if(!a)
		  	{
		  		continue;
		  	}
		  	if(a=="")
		  	{
		    	continue;
		  	}
		  	this.fox(a);
		  	var s=this.list[code[i]];
		  	var price=s["price"];
		 	if(price==0)price=s["previousclose"];
		 	var variable=price-s["previousclose"];
			var percent=variable/s["previousclose"]*100;
		 	var time=s["time"];
		 	percent=percent.toFixed(2);
		 	variable=variable.toFixed(2);	
		 	var img="&nbsp;";	 	
		 	if(variable>0)
		 	{
		    	color="red";
		    	img=this.uImg;
		 	}
		 	else if(variable<0)
		 	{
		   		color="green";
		   		img=this.dImg;
			 }else
		 	{
		    	color="black";
		 	}
		 	var arrow="&nbsp;";
		 	
		 	
		 		
		  	if(this.arrayPriceLast)
		  	{
		    	if(price>this.arrayPriceLast[i])
		    	{
			      	arrow="↑";//"<img src='http://cimg.163.com/stock/u.gif' style=\"border:0px\">";
			      	
			    }else if(price<this.arrayPriceLast[i])
			    {
			      	arrow="↓";//"<img src='http://cimg.163.com/stock/d.gif' style=\"border:0px\">";
			      	
			    }else{arrow="　";}
		  	}
		  	arrayPrice[i]=price;	
		  	var P="<font color="+color+">"+arrow+price+"</font>";
		  	var V="<font color="+color+">"+variable+"</font>";
		  	var C="<font color="+color+">"+percent+"%</font>";		  	
		  	var A="("+P+","+V+","+C+")";
			
		  	this.list[code[i]]["P"]=P;
			this.list[code[i]]["price"]="<font color="+color+">"+price+"</font>";
		  	this.list[code[i]]["V"]=V;
		  	this.list[code[i]]["C"]=C;
		  	this.list[code[i]]["A"]=A;
		  	this.list[code[i]]["img"]=img;
			
		}
		for (var i=0;i<this.quoteElements.length;i++) 
		{
			
		    var code = this.readAttribute(this.quoteElements[i],"code");
		    if(!code)
		    {
			    if(this.maincode&&this.maincode.length==7)
			    	code=this.maincode;
			    else
			    	continue;
		    }	    
		    var type = this.readAttribute(this.quoteElements[i],"type");				    
		    var row = this.list[code];				  
		     var str="--";
		    try{ str = row[type];if(str=="undefined")str="--";}catch(e){}
		   	this.quoteElements[i].innerHTML = str;
  		}
		this.arrayPriceLast=arrayPrice;
		this.response();
	},
	"load_data":function(code)
	{
		if(!this.quoteElements)					
			this.getQuoteElements();
		
		this.add(code);			
		if(this.codes.endWith(";"))		
      		this.codes=this.codes.substring(0,this.codes.length-1);
		if(this.codes&&this.codes.length>=7)
		{
			var nowtime=new Date();    
			var now =""+nowtime.getHours()+nowtime.getMinutes()+nowtime.getSeconds();			
			var url="http://data.quotes.money.163.com/"+now+"?"+this.codes
			var obj=document.getElementById('quote_data_id');
			if(obj)
			{
				//obj.parentNode.removeChild(obj);
				obj.src=url;
			}
			else
			{
				var newscript=document.createElement("script");
				newscript.type="text/javascript";
				newscript.src=url;
				newscript.id="quote_data_id";	  
				document.body.appendChild(newscript);
			}
		}
			if(this.timeout<3000)this.timeout=3000;
			var nowtime2=new Date();  
			var h=nowtime2.getHours();
			if((h>8&&h<12) || (h>12&&h<16))
				this.timer=setTimeout("QuoteData.load_data()",this.timeout);
		
	},
	"load_once":function(code)
	{		
		this.getQuoteElements();
		this.add(code);	
		if(this.codes.endWith(";"))
		{
      		this.codes=this.codes.substring(0,this.codes.length-1);
		}		
		var nowtime=new Date();    
		var now =""+nowtime.getHours()+nowtime.getMinutes()+nowtime.getSeconds();
		var url="http://data.quotes.money.163.com/"+now+"?"+this.codes
     	var obj=document.getElementById('quote_data_id');
     	if(obj)
      	{
       		//obj.parentNode.removeChild(obj);
		obj.src=url;
      	}
	else
	{
      		var newscript=document.createElement("script");
      		newscript.type="text/javascript";
      		newscript.src=url;
      		newscript.id="quote_data_id";		
      		document.body.appendChild(newscript); 
	}
		
	},
	"readAttribute": function(element, name) {
    element = _$(element);
    if (document.all && !window.opera) {
      var t = Element._attributeTranslations;
      if (t.values[name]) return t.values[name](element, name);
      if (t.names[name])  name = t.names[name];
      var attribute = element.attributes[name];
      if(attribute) return attribute.nodeValue;
    }
    return element.getAttribute(name);
  },
	"response":function(){}
}
window.onblur=function()
{
	clearTimeout(QuoteData.timer);
	QuoteData.timer=null;
	//document.title="clear!";
	
}
window.onfocus=function()
{
	if(!QuoteData.timer)
	{
		QuoteData.timer=setTimeout("QuoteData.load_data()",1000);	
		//document.title="set!";
	}
}
function Cookie()
{
	  this.setValue=function(name,value,hours,path,domain,secure)
	  {
		    var str=new String();
		    var nextTime=new Date();
		    nextTime.setHours(nextTime.getHours()+hours);
		    str=name+"="+escape(value);
		    if(hours)
		      str+=";expires="+nextTime.toGMTString();
		    if(path)
		      str+=";path="+path;
		    if(domain)
		      str+=";domain="+domain;
		    if(secure)
		      str+=";secure";
		    document.cookie=str;
	  }
	 this.getValue=function(name)
	  {
		    var rs=new RegExp("(^|)"+name+"=([^;]*)(;|$)","gi").exec(document.cookie),tmp;
		    if(tmp=rs)
		      return unescape(tmp[2]);
		    return null;
	   }
}
var Custom=
{
	"name":"",
	"code":"",
	"nowp":"",
 	"udr":"",
	"compareCookie":document.cookie,
	"cookie":new Cookie(),
	"showCustom":function(elementid){
	if(this.compareCookie!=null&&this.compareCookie!='')
		{
			this.name=this.cookie.getValue("new_quotename");
			this.code=this.cookie.getValue("new_quotecode");
			this.nowp=this.cookie.getValue("new_quotenowp");
			this.udr=this.cookie.getValue("new_quoteudr");		
		}
		if(this.code!=null&&this.code!='')
		{
			var codes=this.code.split("|");
			var names=this.name.split("|");
			var nowps=this.nowp.split("|");
			var udrs=this.udr.split("|");
			n=codes.length;
			var content='';	
			content="<dl><dt>名称  </dt><dd>涨跌</dd></dl>";
			for(i=0;i<(n-1);i++)
			{
				if(i>=7)break;				
				var _code=codes[i];
				if(_code.length<7)
				{
					if(_code.indexOf("0")==0)
						_code="1"+_code;
					else
						_code="0"+_code;
				}						
				content+="<dl><dt><a href=\""+_code+".html\" target=\"_self\"><span class='_quote_' type='name' code='"+_code+"'>"+names[i]+"</span></a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\""+_code+"\">"+udrs[i]+"%</dd></dl>";
				QuoteData.add(_code);
				
			}	
			_$(elementid).innerHTML=content;
			if(n==1||n==0)
			{
				content="<dl><dt>名称  </dt><dd>涨跌</dd></dl>";
				content+="<dl><dt><a href=\"0000001.html\" target=\"_self\">上证指数</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"0000100\">--%</dd></dl>";
				content+="<dl><dt><a href=\"1399001.html\" target=\"_self\">深成指数</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"1399000\">--%</dd></dl>";				
				content+="<dl><dt><a href=\"1399300.html\" target=\"_self\">沪深300</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"1399300\">--%</dd></dl>";				
				
				content+="<dl><dt><a href=\"0000003.html\" target=\"_self\">上证B股</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"0000003\">--%</dd></dl>";				
				content+="<dl><dt><a href=\"1399003.html\" target=\"_self\">深证B股</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"1399003\">--%</dd></dl>";	
				QuoteData.add("1399300,0000003,1399003");
				_$(elementid).innerHTML=content;
			}
		}else
		{
				content="<dl><dt>名称  </dt><dd>涨跌</dd></dl>";
				content+="<dl><dt><a href=\"0000001.html\" target=\"_self\">上证指数</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"0000100\">--%</dd></dl>";
				content+="<dl><dt><a href=\"1399001.html\" target=\"_self\">深成指数</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"1399000\">--%</dd></dl>";				
				content+="<dl><dt><a href=\"1399300.html\" target=\"_self\">沪深300</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"1399300\">--%</dd></dl>";	
				
				content+="<dl><dt><a href=\"0000003.html\" target=\"_self\">上证B股</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"0000003\">--%</dd></dl>";				
				content+="<dl><dt><a href=\"1399003.html\" target=\"_self\">深证B股</a></dt><dd class=\"c1 _quote_\" type=\"C\" code=\"1399003\">--%</dd></dl>";			
				QuoteData.add("1399300,0000003,1399003");
				_$(elementid).innerHTML=content;
		}		
	}
}
var PIC={
	"code":"",
	"id":"_quote_img_",
	"url":"http://img.quotes.money.163.com/chart/",
	"timer":null,
	"ktype":"k30",
	"itype":"macd",
	"showImg":function(type)
	{	
		var now=new Date().getTime();
		var obj=_$("quote_tchart_"+this.code);
		var url=this.url;
		if(obj)
		{
			if(!type)
				type="t";
			if(type=="s")
			{
				url+="stimechart/";
				url+=this.code+".png?"+now;
				obj.src=url;
				setTimeout("PIC.showImg('s')",180000);				
			}
			else if(type=="t")
			{
				url+="timechart/";
				url+=this.code+".png?"+now;
				obj.src=url;
				setTimeout("PIC.showImg('t')",60000);
			}			
		}
		var kobj=_$("quote_kchart_"+this.code);
		if(kobj)
		{url=this.url;
			type=this.ktype;
			//alert(kobj);
			if(type=="k30")
				url+="kchart/30/";
			else if(type=="k90")
				url+="kchart/90/";	
			else if(type=="k180")
				url+="kchart/180/";
			else if(type=="week")
				url+="kchart/week/";
			else if(type=="month")
				url+="kchart/month/";
			url+=this.code+".png?"+now;
			kobj.src=url;
		}
		var iobj=_$("quote_ichart_"+this.code);			
		if(iobj)
		{
			url=this.url;
			type=this.itype;
			if(type=="macd")
				url+="macd/";
			else if(type=="rsi")
				url+="rsi/";	
			else if(type=="boll")
				url+="boll/";
			else if(type=="will")
				url+="will/";
			else if(type=="obv")
				url+="obv/";
			else if(type=="fast")
				url+="fast/";
			url+=this.code+".png?"+now;
			iobj.src=url;
		}
	},
	"showTChart":function(code)
	{		
			if(code)this.code=code;
			//clearTimeout(this.timer);
			var obj=_$(this.id);
			if(obj)
			{
			this.removeChilds(obj);
				var imgobj=document.createElement("img");
				imgobj.id="quote_tchart_"+this.code;
				obj.appendChild(imgobj);
				this.showImg("t");
			}		
	},
	"showK30Chart":function(code)
	{
		if(code)this.code=code;
		this.ktype="k30";
		var obj=_$(this.id);
		if(obj)
		{
			this.removeChilds(obj);
			var imgobj=document.createElement("img");
			imgobj.id="quote_kchart_"+this.code;
			obj.appendChild(imgobj);
			this.ktyp="k30";
			var imgobj2=document.createElement("img");
			imgobj2.id="quote_ichart_"+this.code;
			obj.appendChild(imgobj2);
			this.showImg(this.itype);
		}	
	},
	"showK90Chart":function(code)
	{
		if(code)this.code=code;
		this.ktype="k90";
		var obj=_$(this.id);
		if(obj)
		{
		this.removeChilds(obj);
		var imgobj=document.createElement("img");
		imgobj.id="quote_kchart_"+this.code;
		obj.appendChild(imgobj);
		this.ktyp="k90";
		var imgobj2=document.createElement("img");
		imgobj2.id="quote_ichart_"+this.code;
		obj.appendChild(imgobj2);
		this.showImg(this.itype);
		}	
	},
	"showK180Chart":function(code)
	{
		if(code)this.code=code;
		this.ktype="k180";
		var obj=_$(this.id);
		if(obj)
		{
		this.removeChilds(obj);
		var imgobj=document.createElement("img");
		imgobj.id="quote_kchart_"+this.code;
		obj.appendChild(imgobj);
		this.ktyp="k180";
		var imgobj2=document.createElement("img");
		imgobj2.id="quote_ichart_"+this.code;
		obj.appendChild(imgobj2);
		this.showImg(this.itype);	
		}
	},
		"showWeekChart":function(code)
	{
		if(code)this.code=code;
		this.ktype="week";
		var obj=_$(this.id);
		if(obj)
		{
		this.removeChilds(obj);
		var imgobj=document.createElement("img");
		imgobj.id="quote_kchart_"+this.code;
		obj.appendChild(imgobj);
		this.ktyp="k180";
		var imgobj2=document.createElement("img");
		imgobj2.id="quote_ichart_"+this.code;
		obj.appendChild(imgobj2);
		this.showImg(this.itype);	
		}
	},	
		"showKChart":function(type,code)
	{
		if(code)this.code=code;
		this.ktype=type;
		var obj=_$(this.id);
		if(obj)
		{
		this.removeChilds(obj);
		var imgobj=document.createElement("img");
		imgobj.id="quote_kchart_"+this.code;
		obj.appendChild(imgobj);
		this.ktyp=type;
		var imgobj2=document.createElement("img");
		imgobj2.id="quote_ichart_"+this.code;
		obj.appendChild(imgobj2);
		this.showImg(this.itype);	
		}
	},	
	"showIChart":function(type,code)
	{
		this.ktype="k180";
		if(code)this.code=code;
		this.itype=type;
		var obj=_$(this.id);
		if(obj)
		{
		this.removeChilds(obj);
		var imgobj=document.createElement("img");
		imgobj.id="quote_kchart_"+this.code;
		obj.appendChild(imgobj);
		var imgobj2=document.createElement("img");
		imgobj2.id="quote_ichart_"+this.code;
		obj.appendChild(imgobj2);
		this.showImg(type);	
		}
	},		
	"removeChilds":function(o)
	{
		o.innerHTML="";
		
	}
}
var History={
 	"name":"",
 	"code":"",
 	"nowp":"",
 	"udr":"",
	"compareCookie":document.cookie,
	"cookie":new Cookie(),
	"putHistory":function(code)
	{
		if(this.compareCookie!=null&&this.compareCookie!='')
		{		
			this.name=this.cookie.getValue("new_quotename");			 
		 	this.code=this.cookie.getValue("new_quotecode");
			this.nowp=this.cookie.getValue("new_quotenowp");
			this.udr=this.cookie.getValue("new_quoteudr");
			if(this.code!=null&&this.code.indexOf(code)>=0);
			else if(this.code!=null)
			{
				var codes=this.code.split("|");
				var names=this.name.split("|");
				var nowps=this.nowp.split("|");
				var udrs=this.udr.split("|");
				if(codes.length>9)
				{
					this.code=this.code.substring(this.code.indexOf('|')+1)+code+'|';					
					this.name=this.name.substring(this.name.indexOf('|')+1)+'--|';
					this.nowp=this.nowp.substring(this.nowp.indexOf('|')+1)+'--|';
					this.udr=this.udr.substring(this.udr.indexOf('|')+1)+'--|';
				}
				else
				{					
					this.code=this.code+code+'|';
					this.name=this.name+'--|';
					this.nowp=this.nowp+'--|';
					this.udr=this.udr+'--|';
				}
				
				this.cookie.setValue("new_quotecode",this.code,24000,"/",".163.com");
				this.cookie.setValue("new_quotename",this.name,24000,"/",".163.com");
				this.cookie.setValue("new_quotenowp",this.nowp,24000,"/",".163.com");
				this.cookie.setValue("new_quoteudr",this.udr,24000,"/",".163.com");
			}
			else
			{
				this.cookie.setValue("new_quotecode",code+"|",24000,"/",".163.com");
				this.cookie.setValue("new_quotename","--|",24000,"/",".163.com");
				this.cookie.setValue("new_quotenowp","--|",24000,"/",".163.com");
				this.cookie.setValue("new_quoteudr","--|",24000,"/",".163.com");
			}
		}
		else
		{
			this.cookie.setValue("new_quotecode",code+"|",24000,"/",".163.com");
			this.cookie.setValue("new_quotename","--|",24000,"/",".163.com");
			this.cookie.setValue("new_quotenowp","--|",24000,"/",".163.com");
			this.cookie.setValue("new_quoteudr","--|",24000,"/",".163.com");	
		}
	}
}
function goto()
	{
			var code= document.getElementById("code").value;
			var area= document.getElementById("area").value;
			var skit=",000008,000016,000903,000001,000017,000002,000010,000905,000011,000906,000004,000012,000005,000006,000901,000007,000902,";
			if(area=="0")
			{
				var pattern=/^[0-9]{6}$/;
				if(pattern.test(code)&&code.indexOf(",")==-1)
				{			
					if(skit.indexOf(","+code+",")==-1)
					{
						var market="1";
						if(code.indexOf("6")==0||code.indexOf("9")==0)
						{
							market="0";
							window.open(market+code+".html");
							return false;
						}else if(code.indexOf("0")==0||code.indexOf("2")==0)
						{
							market="1";
							window.open(market+code+".html");
							return false;
						}
					}
				}
				return true;
			}
			else
			{
				var pattern2=/^[0-9]{4}$/;
				if(pattern2.test(code))
				{
					window.location.href="/hkquotes.jsp?code="+code;
					return false;
				}
				return true;
			}
			return true;
		}
		function go(area)
		{
			if(area.value=="1")
			{
				var a=document.getElementById("code");
				if(a.value=="代码/拼音/名称"||a.value=="")
					a.value="代码/名称";
			}
			else
			{
				var a=document.getElementById("code");
				if(a.value=="代码/名称"||a.value=="")
					a.value="代码/拼音/名称";
			}
	}
	function showMyquote()
	{
			var obj=document.getElementById('quote_custom_data_id');
			if(!obj)
			{
				var newscript=document.createElement("script");
				newscript.type="text/javascript";
				newscript.src="http://custom.quotes.money.163.com/mystock.js.jsp";
				newscript.id="quote_custom_data_id";	  
				document.body.appendChild(newscript);
				
			}
	}
	function showMyStock()
	{
			var html = getMyStock();
			_$("custom2").innerHTML=html;
			var elements=document.getQuoteElementsByClassName("_quote_","custom2");
			for(var i=0;i<elements.length;i++)
			{
					var code=QuoteData.readAttribute(elements[i],"code");
					QuoteData.add(code);
			}
			QuoteData.getQuoteElements();
			QuoteData.load_once();
	}