﻿
function vod(){}

//encodeURIComponent可以还处理utf-8编码
function EncodeURL(str){
	return encodeURIComponent(str).replace(/\+/g,"%2b");
}
function escape2(str){
	return escape(str).replace(/\+/g,"%2b");
}

//获取地区
function getSubAreas(provinces,citys){
	if($(provinces).selectedIndex==0 || $(provinces).value==""){
		//当一级菜单未选中时，二级菜单仅保留提示项
		$(citys).length=1;
		return;
	}
	var pars="action=getSubAreas&prid="+$(provinces).value;
	var option={
		method:"get",
		parameters:"s="+Math.random()+"&"+pars,
		onSuccess:function(transport){
			  var response=transport.responseText;
			  if(response=="0")
			  {
			    //二级菜单仅保留提示项
			    $(citys).length=1;
			  }
			  else
			  {
					//获取成功后，将数据填充到二级下拉框
					$(citys).length=1;
					var _arr=eval("("+response+")");
	                for(var i=0;i<_arr.length-1;i+=2){
		                with($(citys)){
			                options[options.length]=new Option(_arr[i],_arr[i+1]);
		                }
	                }
			  }
		},
		onFailure:function(transport){
			alert("网络链接错误！");
		}
	}
	var request=new Ajax.Request("/common/ajax.aspx",option);
}
function seach(iss)
{
    var addr = "/seach.aspx?key="+ EncodeURL($("seachkey").value) +"&type="+ $("seachtype").value;
    if(iss==1)
    {
        window.location.href=addr;
    }
    else
    {
        window.open(addr,"","");
    }
}
function seach2(iss,kw)
{
    var addr;
    if(iss==1)
    {
        window.location.href= "/seach.aspx?key="+ kw +"&type="+ $("seachtype").value;
    }
    else
    {
        addr = "/seach.aspx?key="+ kw +"&type="+ $("seachtype").value;
        window.open(addr,"","");
    }
}

function Online(ID,rand)
{
    var width = 800;
    var height = 600;
//    if(navigator.userAgent.indexOf('MSIE')<0){
//	    alert("为了能正常阅读杂志,请使用Internet Explorer浏览");
//	    return;
//    }

//    try{
//	    var flash = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
//	    var flashVer = flash.flashVersion().toString(16).substr(0,1);
//	    flash = null;
//    }catch(e){}
//    if(flashVer>=8){
//	    this._flash8Installed = true;
//    }else{
//	    this._flash8Installed = false;
//    }
//    if(!this._flash8Installed){
//	    if(confirm("您的Flash版本过低或未曾安装，无法阅读!是否立刻下载Flash插件?")){
//		    var a = document.createElement("a");
//		    a.href = "http://www.bousun.com/Help/flash_setup.exe";
//		    document.body.appendChild(a);
//		    a.click();
//	    }
//	    return;
//    }
window.open('/online/'+ ID+'.aspx', '_blank', 'width='+width+',height='+height+',left='+((screen.Width-width)/2)+',top='+((screen.Height-height-100)/2)+',toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,status=no,title:no');
}