function is_number(str)
{
	exp=/[^0-9()-]/g;
	if(str.search(exp) != -1)
	{
		return false;
	}
	return true;
}

function CheckInput(){

	if(myform.name.value==''){
		alert("您没有填写昵称！");
		myform.name.focus();
		return false;
	}
	if(myform.name.value.length>20){
		alert("昵称不能超过20个字符！");
		myform.name.focus();
		return false;
	}

	if(!is_number(document.myform.qq.value)){
		alert("QQ号必须是数字！");
		myform.qq.focus();
		return false;
	}

	if(myform.content.value==''){
		alert("您没有填写留言内容！");
		myform.content.focus();
		return false;
	}
	if(myform.content.value.length>255){
		alert("留言内容不能超过255个字符！");
		myform.content.focus();
		return false;
	}
	
	return true;
}

function regInput(obj, reg, inputStr)
	{
		var docSel	= document.selection.createRange()
		if (docSel.parentElement().tagName != "INPUT")	return false
		oSel = docSel.duplicate()
		oSel.text = ""
		var srcRange	= obj.createTextRange()
		oSel.setEndPoint("StartToStart", srcRange)
		var str = oSel.text + inputStr + srcRange.text.substr(oSel.text.length)
		return reg.test(str)
	}
	


function doplay(url,mydiv)
{
var texts='大庆生活网'
var str=''
var files=url
var width=320
var height=240
var config='1:自动播放|1:连续播放|100:默认音量|1:控制栏位置|0:控制栏显示|0x000033:主体颜色|60:主体透明度|0x66ff00:光晕颜色|0xffffff:图标颜色|0xffffff:文字颜色|:logo文字|:logo地址|:结束swf地址'
str=str+'<object id=\"TOMAD_LMT\" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+width+'" height="'+height+'">'
str=str+'<param name="movie" value="vcastr2.swf"><param name="quality" value="high">'
str=str+'<param name="menu" value="false"><param name=wmode value="opaque">'
str=str+'<param name="FlashVars" value="vcastr_file='+files+'&vcastr_title='+texts+'&vcastr_config='+config+'">'
str=str+'<embed src="vcastr2.swf" wmode="opaque" FlashVars="vcastr_file='+files+'&vcastr_title='+texts+'&vcastr_config='+config+'" menu="false" quality="high" width="'+width+'" height="'+height+'" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />'
str=str+'</object>'

  var divhot=document.getElementById(mydiv);
   divhot.innerHTML=str;
}
