var MiniSite=new Object();
MiniSite.Browser={
	ie:/msie/.test(window.navigator.userAgent.toLowerCase()),
	moz:/gecko/.test(window.navigator.userAgent.toLowerCase()),
	opera:/opera/.test(window.navigator.userAgent.toLowerCase()),
	safari:/safari/.test(window.navigator.userAgent.toLowerCase())
};
MiniSite.$=function(s){
	return(typeof s=='object')?s:document.getElementById(s);
};
MiniSite.JsLoader={
	load:function(sUrl,fCallback){
		var _script=document.createElement('script');
		_script.setAttribute('charset','gb2312');
		_script.setAttribute('type','text/javascript');
		_script.setAttribute('src',sUrl);
		document.getElementsByTagName('head')[0].appendChild(_script);
		if(MiniSite.Browser.ie){
			_script.onreadystatechange=function(){
				if(this.readyState=='loaded'||this.readyState=='complete'){
					fCallback();
				}
			};
		}else if(MiniSite.Browser.moz){
			_script.onload=function(){
				fCallback();
			};
		}else{
			fCallback();
		}
	}
};
	var marTime = new Array();
	var marWay = new Array();
	var moveTime = new Array();
	moveTime[0] = 0;
	moveTime[1] = 0;
	var speed = 30;
	var fodTime = 0;
	var proFlog = 0;
	var proTime = 0;

	var gh=window.location.host;
	var gu=gh?"http://"+gh:"www.chinagrain.cn";gp=[];gp["grainnews"]=["2","grainnews1.htm"];gp["Soybean"]=["4","Soybean1.htm","Soybean2.htm","Soybean3.htm"];gp["Oil"]=["5","Oil1.htm","Oil2.htm","Oil3.htm","Oil4.htm"];gp["Corn"]=["4","Corn1.htm","Corn2.htm","Corn3.htm"];gp["Meal"]=["5","Meal1.htm","Meal2.htm","Meal3.htm","Meal4.htm"];gp["Wheat"]=["4","Wheat1.htm","Wheat2.htm","Wheat3.htm"];gp["Futures"]=["5","Futures1.htm","Futures2.htm","Futures3.htm","Futures4.htm"];gp["Rice"]=["4","Rice1.htm","Rice2.htm","Rice3.htm"];gp["Inter"]=["5","Inter1.htm","Inter2.htm","Inter3.htm","Inter4.htm"];gp["adAreaA"]=["4","adAreaA1.htm","adAreaA2.htm","adAreaA3.htm"];gp["adAreaB"]=["4","adAreaB1.htm","adAreaB2.htm","adAreaB3.htm"];gp["adAreaD"]=["4","adAreaD1.htm","adAreaD2.htm","adAreaD3.htm"];;gp["adAreaE"]=["4","adAreaD1.htm","adAreaD2.htm","adAreaD3.htm"];
	function $(o){ return (typeof o == "object")?o:document.getElementById(o);}
	function CreatAjax(a,b,c){var obj=CreatXmlRequest();obj.open('GET', a);obj.setRequestHeader("If-Modified-Since","0");obj.send(null);obj.onreadystatechange = function() {if(obj.readyState == 4 && obj.status == 200){b(c,obj.responseText);}}}
	function CreatXmlRequest() {var obj = null;try {obj = new XMLHttpRequest();} catch (e) {try {obj = new ActiveXObject("Msxml2.XMLHTTP");} catch (e) {obj = new ActiveXObject("Microsoft.XMLHTTP");}}return obj;}
	function parseInfo(a,b,c){a.obj.innerHTML=b;swLabs(a.obj,a.sid,a.snum);}
	
	function swTabs(e){
if(typeof e=="string"){e=$(e);}var isAjax,gPath,sobject;var cls="s";if(e.id!="defTail"&&e.id!="tailorxxx"){var tmp=e.id.split("_");var sid=tmp[0];var snum=tmp[1];gPath=gu+gp[sid][snum-1];sobject=$(sid+"_"+snum+"_Info");}else if(e.id=="defTail"){sid=e.id;snum=1;sobject=$("defTailInfo");}else if(e.id=="tailorxxx"){sid=e.id;snum=2;gPath=gu+gp["News"][snum-1];sobject=$("tailorInfo");if(e.className=="s0"||e.className=="s1"){cls="s1";}}e.className=cls;swLabs(sobject,sid,snum);tmp=gPath=sobject=isAjax=maxItemNum=null;}
function swLabs(sobject,sid,snum){var maxItemNum;var tailorxxx=$("tailorxxx");var cls="";try{var i=1;maxItemNum=(sid=="defTail"||sid=="tailorxxx")?gp["News"][0]:gp[sid][0];while(i<=maxItemNum){if(i!=snum){var tmp1,tmp2;if(sid=="defTail"){tmp1=tailorxxx;tmp2=$("tailorInfo");if(tailorxxx.className=="s0"||tailorxxx.className=="s1"){cls="s0";}}else if(sid=="tailorxxx"){tmp1=$("defTail");tmp2=$("defTailInfo");if(tailorxxx.className=="s0"||tailorxxx.className=="s1"){tailorxxx.className="s1";}}else{tmp1=$(sid+"_"+i);tmp2=$(sid+"_"+i+"_Info");}tmp1.className=cls;tmp2.className="undis";}i++}}catch(e){}sobject.className="dis";}
	function tagOver(a){clearTimeout(fodTime);fodTime=0;fodTime = setTimeout(function(){swTabs(a)},100);}
	function tagOut(a){clearTimeout(fodTime);fodTime=0;}

	function getNames(obj,name,tij){var plist = $(obj).getElementsByTagName(tij);var rlist = new Array();for(i=0;i<plist.length;i++){if(plist[i].getAttribute("name") == name){rlist[rlist.length] = plist[i];}}return rlist;}

	function cplay(){var o,n,t,na,c1,c2;o = $(arguments[0]);num=arguments[1];t=arguments[2];n=arguments[3];c1=arguments[4];c2=arguments[5];var f=getNames(o,n,t);for(i=0;i<f.length;i++){if(i == num){f[i].className = c1;}else{f[i].className = c2;}}}

	function formatPageZone()
	{var o1=$(arguments[0]);var o2=$(arguments[0]+"Info");var t1=arguments[1];var n1=arguments[2];var t2=arguments[3];var n2=arguments[4];var c1,c2,c3,c4,c5;		if(arguments.length>5){c1=arguments[5];c2=arguments[6];c3=arguments[7];c4=arguments[8];c5=arguments[9]}		else{c1="s";c2="";c3="dis";c4="undis"}var f=getNames(o1,n1,t1);for(i=0;i<f.length;i++){f[i].value = i;f[i].onclick=function(){fod(o1,o2,this.value,t1,n1,t2,n2,c1,c2,c3,c4)};			f[i].onmouseover=function(){cplay(o1,this.value,t1,n1,c5,c2);};f[i].onmouseout=function(){cplay(o1,this.value,t1,n1,c2,c5);}}}

	function send_request(url)
	{http_request = false;if(window.XMLHttpRequest)	{http_request = new XMLHttpRequest();if(http_request.overrideMimeType){http_request.overrideMimeType('text/xml');}		}else if (window.ActiveXObject)	{try{ http_request = new ActiveXObject("Msxml2.XMLHTTP");}catch (e){try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); }catch (e)	{}}}if (!http_request){window.alert("不能创建XMLHttpRequest对象实例.");return false; }http_request.onreadystatechange = loadPage;	http_request.open("GET", url, true);	http_request.send(null);}

	function loadPage()
	{var ChangeInfo=$("tailorInfo");if(http_request.readyState == 4){var xmldom = http_request.responseXML;var map = $("map");if(xmldom.documentElement.text){				ChangeInfo.innerHTML = xmldom.documentElement.text;}else{ChangeInfo.innerHTML = xmldom.documentElement.textContent;}/*$("tailorArrow").onclick = function(){	if(map.className=="dis"){map.className="undis";}else{map.className="dis";}};$("tailorArrow").onmouseover = function(){this.className="io";};	$("tailorArrow").onmouseout = function(){this.className="i";};*/map.className="undis";}else{ChangeInfo.innerHTML = "<div style='margin:40px auto;width:140px;text-center:center'>正在载入内容....<br />请稍侯!</div>";}}


function loadJS(url,load)
{
	var _script = document.createElement('script');
	_script.setAttribute('type','text/javascript');
	_script.setAttribute('src',url);
	document.getElementsByTagName('head')[0].appendChild(_script);
	if(!load)	return;
	if(document.all){
		_script.onreadystatechange = function(){
			if (this.readyState=='loaded' || this.readyState=='complete')
			{
				load();
			}
		};
	}else{
		_script.onload = function(){
			load();
		};
	}
}

	function loadPng(o)
	{if(MiniSite.Browser.ie){try{var img = o;var imgName = o.src.toUpperCase();if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
	{var imgID = (img.id) ? "id='" + img.id + "' " : "";var imgClass = (img.className) ? "class='" + img.className + "' " : "";var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";var imgStyle = "display:inline-block;" + img.style.cssText;if (img.align == "left") imgStyle = "float:left;" + imgStyle;if (img.align == "right") imgStyle = "float:right;" + imgStyle;if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle ;   var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');\"></span>"; img.outerHTML = strNewHTML;			}}	catch (e){}}}


function register0410(item,page) 
{try{var type = window.event.srcElement.tagName;if (type == "A" || type == "IMG" ) {call_0410(type,item, page);}return true;}catch(e){}}
