//设置viewport
function setViewPort(DocWidth){
var m_screen= window.screen.width;
var m_viewport="DocWidth)
{
m_viewport+=",initial-scale="+ZoomSize+",minimun-scale=1,maximum-scale="+(m_screen / DocWidth);
}else{
m_viewport+=",initial-scale="+ZoomSize+",minimun-scale="+ZoomSize+",maximum-scale=1";
}
m_viewport+=",user-scalable=yes\" />";
document.write(m_viewport);
}
//询问后转址h
function BugsTop(aID)
{
try{
window.top.document.getElementById(aID).src="about:blank";
}catch(e){}
}
function C2L(ShowTxt,ToUrl)
{
if(confirm(ShowTxt)){
window.location=ToUrl;
}
}
//IFRAME 高
function SetCwinHeight(iFname)
{
var cwin=document.getElementById(iFname);
if (document.getElementById)
{
if (cwin && !window.opera)
{
if (cwin.contentDocument && cwin.contentDocument.body.offsetHeight)
cwin.height = cwin.contentDocument.body.offsetHeight;
else if(cwin.Document && cwin.Document.body.scrollHeight)
cwin.height = cwin.Document.body.scrollHeight;
}
}
}
String.prototype.stripAllHTML = function() {
var reTag = /<(?:.|\s)*?>/g; return this.replace(reTag,"").replace(/(^\s*)|(\s*$)/g,"").replace(/[\r\n]/g, "");
}
/*Post*/
function AjaxPostClick(iUrl,showName,data)
{
AjaxClickFull("",iUrl,showName,"",data);
}
function AjaxClick(iUrl,showName)
{
AjaxClickFull("",iUrl,showName,"","");
}
function AjaxClickFull(showAlertText,iUrl,showName,showLoading,data)
{
AjaxClickIt(showAlertText,iUrl,showName,showLoading,"",data);
}
function AjaxClickIt(BeforePostAlert,iUrl,ShowObjID,LoadingObjID,PostingAlertText,postData)
{
if(BeforePostAlert.length>0)
{
if(!confirm(BeforePostAlert))
return;
}
var isSetValue=false;
if(ShowObjID.indexOf("value.")==0)
{
ShowObjID=ShowObjID.substring(6);
isSetValue=true;
}
if(!isSetValue)
{
try{document.getElementById(ShowObjID).innerHTML=PostingAlertText;}catch(e){}
}
if(LoadingObjID!="")
{
try{
document.getElementById(LoadingObjID).style.display="block";
if(!isSetValue)
{
document.getElementById(LoadingObjID).style.display="none";
}
}catch(e){}
}
try{
var postUrl=iUrl+"&A="+Math.random();
if(iUrl.indexOf("?")<0)
{
postUrl=iUrl;
}
var subAjax=newAjax();
subAjax.onreadystatechange=function(){
if(subAjax.readyState==4){
if(subAjax.status == 200)
{
var iResult=subAjax.responseText;
try{
if(!isSetValue)
{
document.getElementById(ShowObjID).innerHTML=iResult;
}else{
document.getElementById(ShowObjID).value=iResult;
}
}catch(e){
//alert(showName+".Error")
alert(iResult);
}
if(LoadingObjID!="")
{
try{
document.getElementById(LoadingObjID).style.display="none";
if(!isSetValue)
{
document.getElementById(ShowObjID).style.display="";
}
}catch(e){}
}
}
}
}
subAjax.open("POST",postUrl,true);
subAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
//subAjax.setRequestHeader("Connection", "close");
//alert("postData(131):"+postUrl+",postData:"+postData);
//subAjax.send(null);
subAjax.send(postData);
}catch(e){
alert("AjaxClick Error!\\n"+e);
}
}
function IframeSubmit(iUrl,FormName)
{
var iForm;
try{
var iForm=document.getElementById(FormName);
}catch(e){
alert(FormName+" Error");
return;
}
var ifName="IFrame_"+FormName;
try{
iForm.action=iUrl;
iForm.target=ifName;
iForm.submit();
}catch(e){
alert(e);
}
}
function AjaxSubmit(iUrl,FormName)
{
AjaxSubmitFull(iUrl,FormName,"");
}
function AjaxSubmitFull(iUrl,FormName,OutRstName)
{
try{
var postUrl=iUrl+"&A="+Math.random();
document.getElementById(FormName).submit();
return;
var parameters=getRequestBody(FormName);
var subAjax=newAjax();
subAjax.onreadystatechange=function(){
if(subAjax.readyState==4){
if(subAjax.status == 200)
{
var dataL1=subAjax.responseText;
var showType=1;
if(dataL1.length>5)
{
if(dataL1.substring(0,6)=="ERROR:")
{
dataL1=dataL1.substring(6);
showType=2;
}
}
if(showType==1)
{
try{
if(OutRstName=="")
{
OutRstName="AjaxForm_"+FormName;
}
var SubmitFormBody=document.getElementById(OutRstName);
SubmitFormBody.innerHTML=dataL1;
}catch(e){
alert("AjaxForm_"+FormName+" Not Exist!");
}
}else if(showType==2)
{
alert(dataL1);
}
try{
document.getElementById("FORM_DOACTION_ACT").disabled=false;
}catch(e){}
}
}
}
subAjax.open("POST",postUrl,true);
subAjax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
subAjax.setRequestHeader("Content-length", parameters.length);
subAjax.setRequestHeader("Connection", "close");
subAjax.send(parameters);
}catch(e){
alert("AjaxSubmit Error!\\n"+e);
}
}
function getRequestBody(oFormName){
var oForm;
try{
oForm=document.getElementById(oFormName);
}catch(e){
alert("Error Get Form");
return "";
}
var sParams="";
for(var i=0;i=0)
{
itemValue = itemK.options[itemK.selectedIndex].value;
}
}catch(e){
//alert(e);
}
//alert(itemK.name+","+itemValue);
}else if( itemK.type=='checkbox' || itemK.type=='radio')
{
if ( itemK.checked == false ){continue;}
itemValue = itemK.value;
}else if ( itemK.type == 'button'
|| itemK.type == 'submit'
|| itemK.type == 'reset' || itemK.type == 'image')
{// ignore this type
continue;
}else{
itemValue = itemK.value;
}
sParams += "&"+ encodeURIComponent(itemK.name) + '=' + encodeURIComponent(itemValue);
}
}
if(sParams.length>0)
{
sParams=sParams.substring(1);
}
return sParams;
}
function addSels(SelName,nvlist,IsClear,selectValue)
{
if(IsClear=="clear")
{
clearSel(SelName);
}
if(nvlist.length==0)
return;
var A=nvlist.split("|");
if(A.length % 2 !=0)
{
clearSel(SelName);
return;
}
var Sel=document.getElementById(SelName);
var item;
//alert(A.length);
for(var i=0;i= 3)
{
oOption.setAttribute("value", A[i]);
}
Sel.appendChild(oOption);
if(selectValue==A[i])
{
Sel[Sel.length-1].selected=true;
}
}catch(e){
alert(e);
break;
}
}
//alert(Sel.length);
}
function addSel(SelName,n,v)
{
try{
var oOption = document.createElement("option");
oOption.appendChild(document.createTextNode(n));
if (arguments.length >= 3)
{
oOption.setAttribute("value", v);
}
document.getElementById(SelName).appendChild(oOption);
}catch(e){
alert(e);
}
}
function clearSel(SelName)
{
try{
var selTarget=document.getElementById(SelName);
if(selTarget.selectedIndex > -1)
{//说明选中
for(var i=0;i'
+''
+''
+''
document.write(flash_a);
}
function formActionWD(f,fAction){
//try{
controlWindow=window.open(fAction
,"surveywin"
,"toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=450,height=300");
document.all[f].target="surveywin";
var selfAction=document.all[f].action;
document.all[f].action=fAction;
document.all[f].submit();
document.all[f].target="_self";
document.all[f].action=selfAction;
//}catch(E){}
}
function reloadPrePage()
{
var parentWin = window.dialogArguments;
parentWin.location.reload();
}
function openJsWD(_target,widtha,heighta)
{
window.open(_target, "_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width="
+widtha+",height="
+heighta);
}
function localPageName()
{
try{
var s = document.location.href;
s = s.substr(s.lastindexof("/")+1);
return s;
}catch(E){
return "";
}
}
function CopyHtml(tDivFrom,tDivTarget,tLen,tVar,keepI_A)
{
tDivTarget.innerHTML =tDivTarget.innerHTML+tDivFrom.innerHTML;
try
{
for(i=1;i<=tLen;i++)
{
var correI=tVar.length-i;
for(var k=0;k=0 && clearIndex√";
return "× "+str+"";
}
function OpenSWd(Url)
{
if(Url =="")
return;
var OKPrintForm = document.createElement("FORM");
document.body.appendChild(OKPrintForm);
OKPrintForm.method = "GET";
OKPrintForm.action=Url;
OKPrintForm.target="_blank";
OKPrintForm.submit();
}
function copyLink(){try{var cText=document.location.toString();if(window.clipboardData){window.clipboardData.setData("Text",cText);alert("复制完成!");}else if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");}catch(e){alert("您的浏览器设置为不允许复制!\n如果需要此操作,请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true',再重试复制操作!");return false;}
var clip=Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);if(!clip)return;var trans=Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);if(!trans){return;}
trans.addDataFlavor('text/unicode');var str=new Object();var len=new Object();var str=Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);str.data=cText;trans.setTransferData("text/unicode",str,cText.length*2);var clipid=Components.interfaces.nsIClipboard;if(!clip)return false;clip.setData(trans,null,clipid.kGlobalClipboard);alert("复制完成!");}}catch(e){}};/* |xGv00|946870e9799bcd16f72c1f8858e736dd */
// 设置为主页
//SetHome(this,window.location)
function SetHome(obj,vrl){
try{
obj.style.behavior='url(#default#homepage)';obj.setHomePage(vrl);
}
catch(e){
if(window.netscape) {
try {
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
}
catch (e) {
alert("此操作被浏览器拒。");
}
var prefs = Components.classes['@mozilla.org/preferences-service;1'].getService(Components.interfaces.nsIPrefBranch);
prefs.setCharPref('browser.startup.homepage',vrl);
}else{
alert("您的浏览器不支持。");
}
}
}
// 加入收藏 兼容360和IE6
//shoucang(document.title,window.location)
function shoucang(sTitle,sURL)
{
try
{
window.external.addFavorite(sURL, sTitle);
}
catch (e)
{
try
{
window.sidebar.addPanel(sTitle, sURL, "");
}
catch (e)
{
alert("加入收藏失败,请使用Ctrl+D进行添加");
}
}
}