<!--
var url=window.location.search;   
var   Request   =   new   Object();   
if(url.indexOf("?")!=-1)   
{   
var   str   =   url.substr(1)   
strs   =   str.split("&");   
for(var   i=0;i<strs.length;i++)   
{   
Request[strs[i].split("=")[0]]=unescape(strs[i].split("=")[1]);   
}   
}   

function feature_window (URLLink) { 
	window.open(URLLink,'','top=0,left=0,width=669,height=569,scrollbars=no,resizable=no'); 
}

function MM_findObj(n, d) {
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_div() {
var i,p,v,obj,args=MM_div.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 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 MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

function replace(s, t, u) {
   i = s.indexOf(t);
   r = "";
   if (i == -1) return s;
   r += s.substring(0,i) + u;
   if ( i + t.length < s.length)
     r += replace(s.substring(i + t.length, s.length), t, u);
   return r;
}

function divpopup(width){
if ((navigator.appName.indexOf('Microsoft')+1)) {
document.write('<style type="text/css"> .divpopup {padding:5px; position:absolute; z-index:1; width: '+width+'px; visibility: hidden; height:1; background:#F7FBFF;line-height : 14pt; border:1px solid #98BBD7;filter:alpha(opacity=100)}'); 
document.write(' .opacity1 {filter:alpha(opacity=100)} .opacity2 {filter:alpha(opacity=100)} </style>'); }
if ((navigator.appName.indexOf('Netscape')+1)) {
document.write('<style type="text/css"> .divpopup {padding:5px; position:absolute; z-index:1; width: '+width+'px; visibility: hidden; height:1; background:#F7FBFF;line-height : 14pt; border:1px solid #98BBD7;-moz-opacity:0.8}'); document.write(' .opacity1 {-moz-opacity:0.8} .opacity2 {-moz-opacity:1} </style>'); }else {
document.write(''); }

/*if ((navigator.appName.indexOf('Microsoft')+1)) {
document.write('<style type="text/css"> .opacity1 {filter:alpha(opacity=80)} .opacity2 {filter:alpha(opacity=100)} </style>'); }
if ((navigator.appName.indexOf('Netscape')+1)) {
document.write('<style type="text/css"> .opacity1 {-moz-opacity:0.8} .opacity2 {-moz-opacity:1} </style>'); 
}else {
document.write(''); }
*/}

var searchVar=0;
var publish='',publishT='';
function addmode(strvalue,strtext){
	document.getElementById("mode").value=strvalue;
	document.getElementById("modetext").value=strtext;
	if(',11354,7479,10052,8238,1966,1965,'.indexOf(','+strvalue+',')!=-1){
		if(searchVar!=1){
			if(publishT==''){
				getSearchBar("dp",1);
			}else{document.getElementById("dp").innerHTML=publishT;}
			document.getElementById("dp").style.width='460px';//440px
			document.getElementById("dp").style.height='auto';
		}
		searchVar=1;
	}else{
		if(searchVar==1||publish==''){
			if(publish==''){
				getSearchBar("dp",2);
			}else{document.getElementById("dp").innerHTML=publish;}
			document.getElementById("dp").style.width='240px';
			document.getElementById("dp").style.height='auto';
		}
		searchVar=0;
	}
	MM_div('dm','','hide');
}
function addgrade(strvalue,strtext){
document.getElementById("grade").value=strvalue;
document.getElementById("gradetext").value=strtext;
MM_div('dd','','hide');}
function addpublish(strvalue,strtext){
document.getElementById("publishCom").value=strvalue;
document.getElementById("publishComtext").value=strtext;
MM_div('dp','','hide');}
function addM(strvalue,strtext,obj){
eval('keyword'+obj).value=strvalue;
eval('keyword'+obj+'text').value=strtext;
MM_div(obj,'','hide');}

function automode(txt,id){
	var obj = document.getElementById("mode");
	if(obj){
	    if(id!=""){
			obj.value=id;
			if(txt!="")
				document.getElementById("modetext").value=txt
			else
				if(Request["title"])document.getElementById("modetext").value=Request["title"];
		}else{
			if(Request["mode"]){
				obj.value=Request["mode"];
				if(txt!="")
					document.getElementById("modetext").value=txt
				else
					if(Request["title"])document.getElementById("modetext").value=Request["title"];
			}
		}
	}
}

function mowie(ur,w,h){
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version==7,0,19,0" width="'+w+'" height="'+h+'"> ');
	document.write('<param name="movie" value="' + ur + '">');
	document.write('<param name="quality" value="high"> ');
	document.write('<param name="wmode" value="transparent"> ');
	document.write('<embed src="' + ur + '" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+w+'" height="'+h+'"></embed> ');
	document.write('</object> ');
}

function MM_swapimages() { //v3.0
  var i,j=0,x,a=MM_swapimages.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_preloadimagess() { //v3.0
  var d=document; if(d.imagess){ if(!d.MM_p) d.MM_p=new Array(); var i,j=d.MM_p.length,a=MM_preloadimagess.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new images; d.MM_p[j++].src=a[i];}}
}

function mOvr(src,clrOver) { if (!src.contains(event.fromElement)) { src.style.cursor = 'hand'; src.bgColor = clrOver; }}
function mOut(src,clrIn) { if (!src.contains(event.toElement)) { src.style.cursor = 'default'; src.bgColor = clrIn; }} 
function mClk(src) { if(event.srcElement.tagName=='TD'){src.children.tags('A')[0].click();} }

function getNames(obj,name,tij)
{	
	var p = document.getElementById(obj);
	var plist = p.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 fod(obj,name)
{
	var p = obj.parentNode.getElementsByTagName("td");
	var p1 = getNames(name,"f","div"); // document.getElementById(name).getElementsByTagName("div");
	for(i=0;i<p1.length;i++)
	{
		if(obj==p[i])
		{
			p[i].className = "s";
			p1[i].className = "dis";
		}
		else
		{
			p[i].className = "";
			p1[i].className = "undis";
		}
	}
}

function fodlf(obj,divname,name)
{
	var p = obj.parentNode.getElementsByTagName("td");
	var p1 = getNames(name,divname,"div"); // document.getElementById(name).getElementsByTagName("div");
	for(i=0;i<p1.length;i++)
	{
		if(obj==p[i])
		{
			p[i].className = "s";
			p1[i].className = "dis";
		}
		else
		{
			p[i].className = "";
			p1[i].className = "undis";
		}
	}
}

function fodlf_o(obj)
{
	var p = obj.parentNode.getElementsByTagName("td");
	for(i=0;i<p.length;i++)
	{
		if(obj==p[i])
		{
			p[i].className = "s";
		}
		else
		{
			p[i].className = "";
		}
	}
}

function FindParentElement(element, tagName)
{
    while(element != null && element.tagName != tagName )
    {
        element = element.parentElement;
    }
    if ( element != null && element.tagName == tagName )
    {
        return element;
    }
    return null;
}

function isNotSearch()
{
if ((document.all['keyword'].value=="" || document.all['keyword'].value=="输入关键词") && document.all['mode'].value=="" && document.all['grade'].value=="" && document.all['publishCom'].value==""){return true;}
if (document.all['keyword'].value=="输入关键词"){document.all['keyword'].value="";}
return false;
}

function isNoBarCode()
{
if ((document.all['barCode'].value=="" || document.all['barCode'].value=="输入同步课本的条形码") || document.all['mode'].value==""){return true;}
return false;
}

function CheckBarCode()
{
	var barCode=document.getElementById('barCode').value;
	if(isNoBarCode()){
		alert('请输入同步课本的条形码！');
		}
	else if(barCode.substring(0,3)!='978'){
		alert('错了哦,条形码前3位是\'978\'哟！');
		document.getElementById('barCode').focus();
			}
	else if(isNaN(barCode)){
		alert('呵呵，条形码输入错误,它应是一串数字呢！');
		document.getElementById('barCode').focus();
			}
	else if(barCode.length!=13){
		alert('错啦错啦,条形码输入不完全啦！\n\n它应是一串国家标准的13位数字的条形码啊！');
		document.getElementById('barCode').focus();
			}
	else{
			window.location='/RSSearchCode.asp?type=rs&amp;keyword='+document.getElementById('barCode').value+'&amp;modeid='+document.all['mode'].value;
			}
}

function DownCount(down_id)//野牛1.0
{
	var http_request;
	var xmlStr="";
	try
	{
		var toUrl="/inc/downcount.asp";
		xmlStr+="id="+down_id;
		
		http_request = getHTTPObject();
		http_request.open("POST",toUrl, false);
		http_request.onreadystatechange = function ()
                {
					if (http_request.readyState == 4){
					   if (http_request.status==200) {
						   if(http_request.responseText!="") alert(http_request.responseText);
					   }else{
						   alert("count is error!");
					   }
					}
				}
		http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		http_request.send(xmlStr);
	}
	catch(ex)
	{alert("script error,&#x8BF7;&#x8054;&#x7CFB;&#x91CE;&#x725B;QQ:493363806!");
	}
}

function DownCountLf(down_id)//野牛2.0
{
	//if(!user_id || user_id == 0) {
	//	alert("下载前,请先登录!");
	//	window.event.srcElement.parentElement.oncontextmenu=function(){return false;};
	//	return false;
	//}
	
	var http_request;
	var xmlStr="";
	try
	{
		if (navigator.appName == "Netscape")   //Netscape
			//if(document.implementation&&document.implementation.createDocument) {
			   var xmlDoc= document.implementation.createDocument("","",null);
			//}

//			if(document.implementation&&document.implementation.createDocument) {
//			var xmldoc = document.implementation.createDocument("", "", null);
//			xmldoc.onload =  handler(xmldoc, url);
//			xmldoc.load(url);
//			}wildbull
			
		else    //IE
			var xmlDoc = new ActiveXObject("Msxml2.DOMDocument");   
		var toUrl="/inc/downcountlf.asp";
		xmlDoc.async = false;

		xmlStr="<params>";
		xmlStr+="<downid>" + down_id + "</downid>";	
		xmlStr+="</params>";
		
		if(window.ActiveXObject) {				// IE　浏览器
			xmlDoc.loadXML(xmlStr); alert(xmlDoc.selectSingleNode("params/downid").text+"IE");
		}
		else if(window.XMLHttpRequest) {	// Mozilla 浏览器
			var DOM = new DOMParser();
			var DOMdoc = DOM.parseFromString(xmlStr,"text/xml");
			xmlDoc.load(DOMdoc); alert(xmlDoc.selectSingleNode("params/downid").text);
		}
		
		http_request = getHTTPObject();
		http_request.open("POST",toUrl, false);
		http_request.onreadystatechange = function () 
                {
					if (http_request.readyState == 4){
					   if (http_request.status==200) {
						   alert(http_request.responseText);
					   }else{
						   alert("count is error");
					   }
					}
				}
		http_request.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		http_request.send(xmlDoc);
	}
	catch(ex)
	{alert("script error!");
	}
}	

function getSearchBar(a,aj)//野牛1.0
{
	var http_request;
	try
	{
		var toUrl="/jsSearchBar.asp?types=1&aj="+aj;
		http_request = getHTTPObject();
		http_request.open("GET",toUrl, true);
		http_request.onreadystatechange = function(){updateSearchBar(a,http_request,aj)}
		http_request.send(null);
	}
	catch(ex)
	{alert("script error,");//+ http_request.status+toUrl
	}
}

function updateSearchBar(a,http_request,aj){
　if (http_request.readyState == 4) {
　　if (http_request.status == 200) {
		var http_response = http_request.responseText;
		//if(http_response.indexOf("getclasserror")==-1){
//			alert(http_response);
			if(aj==1){publishT=http_response}else{publish=http_response}
			var wordObj=document.getElementById(a);
			if (wordObj)wordObj.innerHTML=http_response;
		//}else{alert("数据处理错误！");}
　　}else{
      alert("status is " + http_request.status);
	}
　}
}

function getHTTPObject(){
    var xmlhttp_request = false;
    try{
        if( window.ActiveXObject ){
            for( var i = 5; i; i-- ){
                try{
                    if( i == 2 ){
                        xmlhttp_request = new ActiveXObject( "Microsoft.XMLHTTP" );
                    }else{
                        xmlhttp_request = new ActiveXObject( "Msxml2.XMLHTTP." + i + ".0" );
                        xmlhttp_request.setRequestHeader("Content-Type","text/xml");
                        xmlhttp_request.setRequestHeader("Content-Type","gb2312");
                    }
                    break;
                }catch(e){
                    xmlhttp_request = false;
                }
            }
        }else if( window.XMLHttpRequest ){
            xmlhttp_request = new XMLHttpRequest();
            if (xmlhttp_request.overrideMimeType) {
                xmlhttp_request.overrideMimeType('text/xml');
            }
        }
    }catch(e){
        xmlhttp_request = false;
    }
    return xmlhttp_request ;
}

function isArray(test){
	if(typeof test == 'object' && typeof test.sort == 'function' && typeof test.length == 'number')
	{
		return true;
	}else{
		return false;
	}
}

function myKeyDown(){
    var k=window.event.keyCode;   
    if (!((k==46)||(k==8)||(k==13)||(k==9)||(k>=48 && k<=57)||(k>=96 && k<=105)||(k>=37 && k<=40)))
	{alert('呵呵，只能输入数字哟！');window.event.returnValue = false;}
}

function positionCursor(input, position){
	var range = input.createTextRange();
	range.collapse(true);
	range.moveStart('character', position);
	range.select();
}

//-->