function isValidPhone(numStr) {
	var myReg = /(^[0][0-9]{2,3}\-[0-9]{7,8}$)|(^0{0,1}15[0-9]{9}$)|(^0{0,1}13[0-9]{9}$)|(^[0][0-9]{2,3}[0-9]{7,8}$)/;
	return myReg.test(numStr);
}
function isValidEmail(emailStr) {
	var myReg = /(^[\w-\.]{1,}\@([\da-zA-Z-]{1,}\.){1,}[\da-zA-Z-]{2,3}$)/;
	return myReg.test(emailStr);
}
function IsChinese(obj){
	re = new RegExp("[^0-9a-z_\u4e00-\u9fa5]","i");
	r  = obj.value.match(re) ;
	if(r!=null){
   		return false;
	}else{
		return true;
	}
}
function modalDialogShow(url,width,height){
    var left = screen.availWidth/2 - width/2;
    var top = screen.availHeight/2 - height/2;
    activeModalWin = window.open(url, "", "width="+width+"px,height="+height+",left="+left+",top="+top);
    window.onfocus = function(){if (activeModalWin.closed == false){activeModalWin.focus();};};
}
function createFlash(strUrl,strWidth,strHeight) {
	var strContent = '';
	strContent = "<OBJECT codeBase=http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0 classid=clsid:D27CDB6E-AE6D-11cf-96B8-444553540000 width=" + strWidth + " height=" + strHeight + "><PARAM NAME=movie VALUE='" + strUrl + "'><PARAM NAME=quality VALUE=high><embed src='" + strUrl + "' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' width=" + strWidth + " height=" + strHeight + ">" + strUrl + "</embed></OBJECT>";
	document.write(strContent);
}
function createImg(strUrl, strWidth, strHeight, strLink, strTitle, stradd) {
	var strContent = '';
//	strContent = "<a href='" + strLink + "' target='_blank' title='" + strTitle + "'><img src='" + strUrl + "' border='0' onload='reDraw(this, " + strWidth + ", " + strHeight + ")'  alt='" + strTitle + "' " + stradd + " /></a>"
	strContent = "<a href='" + strLink + "' target='_blank' title='" + strTitle + "'><img src='" + strUrl + "' border='0' width='" + strWidth + "' height='" + strHeight + "'  alt='" + strTitle + "' " + stradd + " style='margin-bottom:5px;'/></a>"
	document.write(strContent);
}

function reDraw(myimg,mywidth,myheight) {
	var tmp_img = new Image();
	tmp_img.src = myimg.src;
	image_x = tmp_img.width;
	image_y = tmp_img.height;

	if (image_x > mywidth) {
		tmp_img.height = image_y*mywidth/image_x;
		tmp_img.width = mywidth;

		if (tmp_img.height > myheight)  {
			tmp_img.width = tmp_img.width*myheight/tmp_img.height;
			tmp_img.height = myheight;
		}
	} else if (image_y > myheight) {
		tmp_img.width = image_x*myheight/image_y;
		tmp_img.height = myheight;
		if (tmp_img.width > mywidth) {
			tmp_img.height = tmp_img.height*mywidth/tmp_img.width;
			tmp_img.width = mywidth;
		}
	}
	myimg.width = tmp_img.width;
	myimg.height = tmp_img.height;
}