function NewsCentrer(page,largeur,hauteur,options) {
  var top=(screen.height-hauteur)/2;
  var left=(screen.width-largeur)/2;
  var tmp=window.open(page,"map","top="+top+",left="+left+",width="+largeur+",height="+hauteur+","+options);
  tmp.focus();
}

function jump(obj){
  window.open(obj.options[obj.selectedIndex].value,'','')
  obj.selectedIndex=0
}

/*功能:		输出省份、城市、区域
  参数说明：
*/
function SetDistrict(DistrictInfo,OutputType,strControl,infoID,selectedID,strText) {
	var last,found,info,temp;
	var Control = eval(strControl);
	Control.length = 0;
	Control.options[Control.length++].value = "";
	Control.options[Control.length-1].text = strText == "" ? "--请选择--" : strText;
	if(DistrictInfo == "") {return;}
	switch(OutputType) {
		case "Province" :
			last = null;
			info = DistrictInfo.split("■");
			for(var i = 0; i < info.length; i++) {
				temp = info[i].split("□")[0].split("▲");
				if(last != temp[0]) {
					last = temp[0];
					if(temp[0] != "") {
						Control.options[Control.length++].value = temp[0];
						Control.options[Control.length-1].text = temp[1];
						if(temp[0] == selectedID) {Control.selectedIndex = Control.length-1;}
					}
				}
			}
			break;
		case "City" :
			last = null;
			found = false;
			info = DistrictInfo.split("■");
			for(var i = 0; i < info.length; i++) {
				temp = info[i].split("□")[0].split("▲");
				if( infoID == temp[0] && last != info[i].split("□")[1].split("▲")[0]) {
					last = info[i].split("□")[1].split("▲")[0];
					found = true;
					if(info[i].split("□")[1].split("▲")[0] != "") {
						Control.options[Control.length++].value = info[i].split("□")[1].split("▲")[0];
						Control.options[Control.length-1].text = info[i].split("□")[1].split("▲")[1];
						if(info[i].split("□")[1].split("▲")[0] == selectedID) {Control.selectedIndex = Control.length-1;}
					}
				}
				else if(infoID != temp[0] && found) {
					break;
				}
			}
			break;
		case "District" :
			found = false;
			info = DistrictInfo.split("■");
			for(var i = 0; i < info.length; i++) {
				temp = info[i].split("□")[1].split("▲");
				if( infoID == temp[0]) {
					found = true;
					if(info[i].split("□")[2].split("▲")[0] != "") {
						Control.options[Control.length++].value = info[i].split("□")[2].split("▲")[0];
						Control.options[Control.length-1].text = info[i].split("□")[2].split("▲")[1];
						if(info[i].split("□")[2].split("▲")[0] == selectedID) {Control.selectedIndex = Control.length-1;}
					}
				}
				else if(infoID != temp[0] && found) {
					break;
				}
			}
			break;
		default :
		
	}
}
//日期有效性检查函数
function VerifyDate(dtDate)
{	var dtReg = /^(\d{4})(\/|-)(\d{1,2})(\/|-)(\d{1,2})$/;
	var temp = dtReg.exec(dtDate);
	if(temp == null) return false;
	var date = new Date(temp[1],temp[3]-1,temp[5]);
	return date.getFullYear() == temp[1] && date.getMonth() == (temp[3]-1) && date.getDate() == temp[5];
}
//邮件有效性检查函数
function VerifyEmail(email) {
	var reg = /^([a-zA-Z0-9_\.-]+)@(([a-zA-Z0-9_-]+)\.)+[a-zA-Z]{2,3}$/;
	if( reg.test(email) ) {	return true;}
	return false;
}
//电话有效性检查函数
function VerifyTelephone(telephone) {
	var reg = /^((((\(|（){0,1}[0-9]{3,4}(\)|）|-| ){0,1}){0,1}[0-9]{7,8}((-| ){1}[0-9]+)*)|(0{0,1}13[0-9]{9})){1}$/;
	if( reg.test(telephone) ) {	return true;}
	return false;
}
//图片显示的缩放比例(低IE版本不支持style="zoom:30%")
function showImage(image,validWidth,validHeight)
{
	var img = new Image();
	img.src = image.src;
	var zoom = validWidth * 100 / img.width;
	if(zoom > validHeight * 100 / img.height)
		zoom = validHeight * 100 / img.height;
	zoom = zoom > 100 ? 100 : zoom;
	image.width = parseInt(img.width * zoom / 100, 10);
	image.height = parseInt(img.height * zoom / 100, 10);
}









