function trim(str){ for(var i = 0 ; i0 && str.charAt(j-1)==" " ; j--) ; if(i>j) return ""; return str.substring(i,j); } function showbrowser(obj,tof,selecturl,viewurl,idname,isonlyone,tmid) { var form=obj.form; var objname=getBrowserName(obj.id); var index=getIndex(obj); //alert(form.name); var url=selecturl; if(url.indexOf("?")>-1) { url=url+"&value="+getObject(objname).value; }else { url=url+"?value="+getObject(objname).value; } url=url+"&tmid="+tmid; url=url+"&index="+index; url=url+"&isonlyone="+isonlyone; url=url+"&objname="+objname; url=url+"&viewurl="+viewurl+"&idname="+idname; url=url+"&tof="+tof; //alert(url); //getObject("webbody").innerHTML+=url; openwin(url,500,500); } function getBrowserName(nm) { var l=nm.lastIndexOf("__"); return nm.substring(0,l); } function openfull(url) { var width = screen.width ; var height = screen.height ; var szFeatures = "top=0," ; szFeatures +="left=0," ; szFeatures +="width="+width+"," ; szFeatures +="height="+height+"," ; szFeatures +="directories=no," ; szFeatures +="status=no," ; szFeatures +="menubar=no," ; if (height <= 600 ) szFeatures +="scrollbars=no," ; else szFeatures +="scrollbars=no," ; szFeatures +="resizable=yes" ; //channelmode window.open(url,"",szFeatures) ; } function setObject(paras,index) { try { var l=paras.length; for(var i=0;i 1200){ Pop=window.open(url,"mcePopup",dimentions_and_such1); }else{ Pop=window.open(url,"mcePopup",dimentions_and_such1); } Pop.focus(); }catch(e){;} } } function popupDialog(url,width,height){ //showx = event.screenX - event.offsetX - 4 - 10 ; // + deltaX; 这段代码只对IE有效,已经不用了 //showy = event.screenY - event.offsetY -168; // + deltaY; 这段代码只对IE有效,已经不用了 var x = parseInt(screen.width / 2.0) - (width / 2.0); var y = parseInt(screen.height / 2.0) - (height / 2.0); var isMSIE= (navigator.appName == "Microsoft Internet Explorer"); //判断浏览器 if (isMSIE) { retval = window.showModalDialog(url, window, "dialogWidth:"+width+"px; dialogHeight:"+height+"px; dialogLeft:"+x+"px; dialogTop:"+y+"px; status:no; directories:yes;scrollbars:no;Resizable=no; " ); //alert(retval); } else { var win = window.open(url, "mcePopup", "top=" + y + ",left=" + x + ",scrollbars=" + scrollbars + ",dialog=yes,modal=yes,width=" + width + ",height=" + height + ",resizable=no" ); eval('try { win.resizeTo(width, height); } catch(e) { }'); win.focus(); } } //使子窗口获得焦点 var sunwindow; function focussun() { try { if(window!=sunwindow) { sunwindow.focus(); } }catch(Exx) { } } try { window.onfocus = focussun; window.onclick=focussun; }catch(exc) { } //打开一个子窗口 function openwin(url,width,height) { sunwindow=window.open (url,"newwindow","height="+height+",width="+width+",top=50,left=100,toolbar=no,menubar=no,scrollbars=yes, resizable=no,location=no, status=no"); sunwindow.onblur=focussun; sunwindow.focus(); } //定位Select选项 function ChangeSel(Oid,Str,stat){ //alert(Oid+"--"+Str+"--"+stat); if(getObject(Oid)!=null){ switch(stat){ case "select": getObject(Oid).value=Str; break; case "brows": getObject(Oid).value=Str; if(getObject(Oid+"__span")) getObject(Oid+"__span").innerHTML=Str; break; case "checkbox": if(Str=="true") getObject(Oid).checked="checked"; break; case "radio": if(Str=="true") getObject(Oid).checked="checked"; break; default: getObject(Oid).value=Str; break; } } } //cookie var domain=".soyi.cc"; function setWebCookie() { //alert(getWebCookie("Welcome")); if (getWebCookie("Welcome")== null ) { var expires = new Date(); expires.setTime(expires.getTime() + 4*60*60*1000); var the_cookie = "Welcome=welcome;path=/;domain="+domain+";expires="+ expires.toGMTString(); document.cookie = the_cookie; //alert(the_cookie); } } function getWebCookie(cookieName) { var cookieString = document.cookie; var start = cookieString.indexOf(cookieName + '='); if (start == -1) return null; start += cookieName.length + 1; var end = cookieString.indexOf(';', start); if (end == -1) return unescape(cookieString.substring(start)); return unescape(cookieString.substring(start, end)); } setWebCookie(); function getXmlHttp(){ var http_request = false;//开始初始化XMLHttpRequest对象 if(window.XMLHttpRequest) { //Mozilla 浏览器 http_request = new XMLHttpRequest(); if (http_request.overrideMimeType) {//设置MiME类别 http_request.overrideMimeType('text/xml'); } } else if (window.ActiveXObject) { // IE浏览器 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; } return http_request; } //取得Brows的label..getlabel.jsp function GetSeldata(did,id,oid){ http_request = getXmlHttp(); http_request.onreadystatechange = function() {// 处理返回信息的函数 //alert(http_request.readyState); if (http_request.readyState == 4) { // 判断对象状态 if (http_request.status == 200){ var xmldoc=http_request.responseXML; var pxml=xmldoc.getElementsByTagName("root"); if(pxml.length>0){ //alert(did+"--"+pxml[0].getElementsByTagName("Label")[0].firstChild.data); //if(getObject(did+"__span")){ getObject(did+"__span").innerHTML=pxml[0].getElementsByTagName("Label")[0].firstChild.data; //} //if(getObject(did)){ getObject(did).value=id; //} } //var rtext=http_request.responseText; //alert(rtext); } } } http_request.open("GET", "/web/getlabel.jsp?objectid="+oid+"&id="+id, true); http_request.send(null); } function topFloatAdMove(){topFloatAdJudge();setTimeout('topFloatAdMove();',200)} function topFloatAdJudge(){ var im=getObject("itemMenu"); if(im){ im.style.top = (document.body.scrollTop?document.body.scrollTop+10:document.documentElement.scrollTop+10) + 'px'; im.style.left = document.body.clientWidth -180 + 'px'; } } function topFloatInit(){ var menu=getObject("menu"); var ifh=26; if(menu){ var menus=""; for(var i=0;i"+menu.rows[i].cells[0].getElementsByTagName("DIV")[0].innerHTML+""; ifh=ifh*(i+1); alert(menus); }catch(e){} } var im=getObject("itemMenu"); im.style.display="block"; im.style.position="absolute"; im.style.width="160px"; im.style.height=ifh+"px"; im.style.text_align="center"; im.style.border="0px solid"; im.innerHTML=""; var doc=window.frames["mymenu"].document; doc.open(); doc.write(menus); doc.close(); } } function findPosX(obj) { var curleft = 0; if (obj.offsetParent) { while (obj.offsetParent) { curleft += obj.offsetLeft; obj = obj.offsetParent; } } else if (obj.x) curleft += obj.x; return curleft; } function findPosY(obj) { var curtop = 0; if (obj.offsetParent) { while (obj.offsetParent) { curtop += obj.offsetTop; obj = obj.offsetParent; } } else if (obj.y) curtop += obj.y; return curtop; } //window.onload=function(){ if(window.location.href.indexOf("system")>-1){ var Interval=2000; //var handleInterval=setInterval("TimerCallBacks()",Interval); } //} function TimerCallBacks(){ //try{ if(window.document.body){ topFloatInit(); topFloatAdJudge(); topFloatAdMove(); clearInterval(handleInterval); } //}catch(e){} } //---------------------------------------------------- var ie = (navigator.appVersion.indexOf("MSIE")!=-1);//IE var ff = (navigator.userAgent.indexOf("Firefox")!=-1);//Firefox //document.write("
"); //document.write("
"); Array.prototype.c = Array.prototype.concat; function buffer(){ //var s = []; var menu=getObject("itemMenu");//var menus=""; if(menu){ var rd=document.createElement("div"); rd.id="rightmenu"; var rdd=document.createElement("div"); rdd.id="rightmenubg"; rd.innerHTML=menu.innerHTML; //alert(menu.innerHTML); document.body.appendChild(rd); document.body.appendChild(rdd); document.body.onclick=function(){bodyclick();}; document.body.oncontextmenu=(ff)?function(event){return showcontextmenu(event);}:function(){return showcontextmenu(event);}; /*for(var i=0;i "+menu.rows[i].cells[0].getElementsByTagName("DIV")[0].innerHTML+""]); //menus+=""+menu.rows[i].cells[0].getElementsByTagName("DIV")[0].innerHTML+""; menus+="
"+menu.rows[i].cells[0].getElementsByTagName("DIV")[0].innerHTML+"
"; ifh=ifh*(i+1); //alert(menu.rows[i].cells[0].getElementsByTagName("TR")[0].getAttribute("onclick").statements); }catch(e){alert(e.description)} }*/ } /*s = s.c([" 项目一"]); s = s.c([" 项目二"]); s = s.c([" 项目三"]); s = s.c(["
"]); s = s.c([" 项目五"]); s = s.c([" 项目六"]); s = s.c([" 项目七"]); s = s.c([" 项目作"]); //s = s.join(""); //document.getElementById("rightmenu").innerHTML = s; rd.innerHTML=s; //alert(s.length); if(s.length>0){ document.body.appendChild(rd); document.body.appendChild(rdd); document.body.onclick=function(){bodyclick();}; document.body.oncontextmenu=(ff)?function(event){return showcontextmenu(event);}:function(){return showcontextmenu(event);}; }*/ } var ex=0,ey=0; function showcontextmenu(evt){ ex = evt.clientX;ey = evt.clientY; rxy(); document.getElementById("rightmenu").style.display = "block"; document.getElementById("rightmenubg").style.display = "block"; evt.cancelBubble = true; return false; } function bodyclick(){ //alert(document.body.getAttribute("oncontextmenu")); document.getElementById("rightmenu").style.display = "none"; //关闭右键菜单 document.getElementById("rightmenubg").style.display = "none";//关闭右键菜单 } function rxy(){var body = document.body; var step=3; if(ie){step=1} if(ff){step=6} //alert(ey+"--"+body.clientHeight); if(ex+150>body.clientWidth){ document.getElementById("rightmenu").style.left = ex - 150+"px"; document.getElementById("rightmenubg").style.left = ex - 150+step+"px"; }else{ document.getElementById("rightmenu").style.left = ex+"px"; document.getElementById("rightmenubg").style.left = ex+step+"px"; } if(ey+40>body.clientHeight){ document.getElementById("rightmenu").style.top = ey - 20+"px"; document.getElementById("rightmenubg").style.top = ey - 20+step+"px"; }else{ document.getElementById("rightmenu").style.top = ey+"px"; document.getElementById("rightmenubg").style.top = ey+step+"px"; } } function showcontextmenu(evt){ ex = evt.clientX;ey = evt.clientY; rxy(); document.getElementById("rightmenu").style.display = "block"; document.getElementById("rightmenubg").style.display = "block"; evt.cancelBubble = true; return false; } window.onload = function(){buffer();} //---------------------------------------------------- //搜索---------------------------------------------------------- function listw(o){ var obj=document.getElementById(o); var objstr=document.getElementById("forwhat").innerHTML; obj.className="listws"; var ele=obj.getElementsByTagName("LI"); for(var i=0;i0){ //document.write(""); //} //登录到BBS服务器 function loginbbs(url) { //初始化、指定处理函数、发送请求的函数 http_request = getXmlHttp(); //alert(http_request); //var subname=getObject(ids+"list"); http_request.onreadystatechange = function() { //alert(http_request.readyState); // 处理返回信息的函数 if(http_request.readyState==2) { //alert("提交"); }else if (http_request.readyState == 4) { // 判断对象状态 //alert(http_request.status+"|||"); //alert(http_request.responseText); if (http_request.status == 200) { // 信息已经成功返回,开始处理信息 alert(http_request.responseText); } } } // 确定发送请求的方式和URL以及是否同步执行下段代码 http_request.open("GET", url, true); http_request.send(null); //return true; } //订阅信息(信息类,产品类,公司,品牌,订阅类,订阅方式) function subScript(i,p,o,b,s,u){ var url="/web/html/subscription.jsp"; var urlc="i=i"; urlc+=(i.length>=32)? "&Info.Types="+i:""; urlc+=(p.length>=32)? "&Product.Trade="+p:""; urlc+=(o.length>=32)? "&Organ.Id="+o:""; urlc+=(p.length>=32)? "&Product.Brand="+b:""; url+="?"+urlc; if(s.length>0){ var elements=document.getElementById(s).getElementsByTagName("INPUT"); var counter=elements.length; var subs=""; for(i=0;i","\n"); str=str.replace("
","\n"); alert(str); }else{ str=result[0].firstChild.data; str=str.replace("
","\n"); str=str.replace("
","\n"); alert(str); window.location.reload(true); } } }else{ alert("成功"); } } } } http_request.open("GET", u, true); http_request.send(null); } function getRow(s){ return s.parentNode.parentNode.rowIndex; } function setRow(s){ try { var rs=getObject("Rowstor"); if(rs){ rs.value=s; }else{ var inpu=document.createElement("input"); inpu.id="Rowstor"; inpu.name="Rowstor"; inpu.value=s; inpu.type="hidden"; document.body.appendChild(inpu); //alert(inpu.value); } }catch(eff) { } } function delscript(msg,url,ele) {if (confirm(msg)) {setRow(ele);delListitem(url);}return false;} function delscriptbyurl(msg,url) {if (confirm(msg)) {location.href=url;}return false;}