function CheckIsNull(obj,msg)
{
	if(obj.value=="")
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}


function CheckAllIsNull(obj,msg)
{
	if(!obj.length)
	{
		alert(msg);
		return false;
	}
	else	
	{
		for(var i=0;i<obj.length;i++)
		{
		if(obj[i].value)return true;
		}
	}
	return false;
}

function CheckOnly(obj,msg)
{
	if(!obj.length)
	{
		alert(obj.length);
		return false;
	}
}

function CheckIsChecked(obj,msg)
{
	var result;
	result=false;

	if(!obj.length)
	{
		if(!obj.checked) alert(msg);
	}
	else
	{
		for(var i=0;i<obj.length;i++)
		{
			if(obj[i].checked)
			{
				result=true;
				break;
			}
		}
		if(!result) alert(msg);
	}
	return result;
}

function CheckIsEmail(obj,msg)
{
	var reg=/^([a-zA-Z0-9_-]*)\@([a-zA-Z0-9_-]*)\.([a-zA-Z0-9_.]{2,6})$/;
	if(!reg.exec(obj.value))
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}
function CheckIsEmailc(obj)
{
	var reg=/^([a-zA-Z0-9_-]*)\@([a-zA-Z0-9_-]*)\.([a-zA-Z0-9_.]{2,6})$/;
	if(!reg.exec(obj))
	{
		return false;
	}
	return true;
}
function CheckIsId(obj,msg)
{
	var reg=/^([0-9]{18})|([0-9]{15})$/
	if(!reg.exec(obj.value))
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}


function CheckIsNumeric(obj,msg)
{
	var reg=/^[0-9]*$/
	if(!reg.exec(obj.value))
	{
		alert(msg);
		obj.focus();
		return false;
	}
	return true;
}


function CheckIsDate(obj)
{
	var reg=/^([0-9]{2,4})\/([0-9]{1,2})\/([0-9]{1,2})$/
	if(!reg.exec(obj.value))
	{
		alert("请输入以下格式的日期\n格式：2000/05/25");
		obj.focus();
		return false;
	}
	return true;
}


function CheckIsDateSE(obj)
{
	var reg=/^([0-9]{2,4})\/([0-9]{1,2})\~([0-9]{2,4})\/([0-9]{1,2})$/
	if(!reg.exec(obj.value))
	{
		alert("请输入以下格式的日期\n格式：2000/05~2001/11");
		obj.focus();
		return false;
	}
	return true;
}

//判断是否为一个正确的用户名：姓名＋数字＋下划线
function CheckIsUserName(obj)
{
	var reg=/^[0-9a-zA-Z\_]*$/
	if(!reg.exec(obj.value))
	{
		alert("您输入用户名包含非法字符！用户名只能为数字、下划线_和大小写字母。");
		obj.focus();
		return false;
	}
	return true;
}

function DelCheck(obj) {if(CheckIsChecked(obj,'请选择至少一个记录'))
	return confirm("\n确定要做删除操作吗？删除后将不能恢复，不是的话，请按取消！");
	else
	return false;
}

function addCheck(obj) {if(CheckIsChecked(obj,'请选择至少一个记录'))
	return confirm("\n确定要更改吗？不是的话，请按取消！");
	else
	return false;
}

function linebr(obj)
{
	obj.value+="<br>";
}

function CheckAll(form){for (var i=0;i<form.elements.length;i++){var e = form.elements[i];if (e.name != 'chkall')e.checked = !e.checked;}}

function view2(url){ 
var url; window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=110,width=600,height=460'); 
}

function view1(url){ 
var url; window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=110,width=418,height=300'); 
}

function view(url){ 
var url; window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=110,width=600,height=500'); 
}
function changelocationty(locationid,thecontrol,countx,subvalue)	   
	    {
        var locationid=locationid;
        var thecontrol=thecontrol;
	var countx=countx;
	var subvalue=subvalue;
	    thecontrol.length = 1;
 	    thecontrol.options[0] = new Option('==请选择==','');
		for (i=0;i < countx; i++)if(subvalue[i][1] == locationid)thecontrol.options[thecontrol.length] = new Option(subvalue[i][0], subvalue[i][2]);
		}

function changelocation(locationid,thecontrol)	   
	    {
        var locationid=locationid;
        var thecontrol=thecontrol;
	    thecontrol.length = 1;
 	    thecontrol.options[0] = new Option('==请选择==','');
		for (i=0;i < onecount; i++)if(subcat[i][1] == locationid)thecontrol.options[thecontrol.length] = new Option(subcat[i][0], subcat[i][2]);
		}

function changelocation1(locationid,thecontrol)	   
	    {
       	    thecontrol.length = 1; 
 	    thecontrol.options[0] = new Option('==请选择==','');
		for (i=0;i < twocount; i++)if(subval[i][1] == locationid)thecontrol.options[thecontrol.length] = new Option(subval[i][0], subval[i][2]);
		}
function openem(url)
{ 
var url;var win; win=window.open(url,'_blank','status=no,scrollbars=yes,top=20,left=110,width=500,height=100');  
}


function picshow(pics,links,texts,focus_width,focus_height,text_height){
				var swf_height = focus_height+text_height;				
document.write('<embed src="/520838/images/pixviewer.swf" wmode="opaque" FlashVars="pics='+pics+'&links='+links+'&texts='+texts+'&borderwidth='+focus_width+'&borderheight='+focus_height+'&textheight='+text_height+'" menu="false" bgcolor="#dadada" quality="high" width="'+ focus_width +'" height="'+ swf_height +'" allowScriptAccess="sameDomain" />');
/*
document.write('<object  width="'+ focus_width +'" height="'+ swf_height +'">');
				document.write('<param name="allowScriptAccess" value="sameDomain"><param name="movie" value="/520838/images/pixviewer.swf"><param name="quality" value="high"><param name="bgcolor" value="#E7E3CE">');
				document.write('<param name="menu" value="false"><param name=wmode value="opaque">');	
				
				document.write('</object>'); */
}


function DrawImage(ImgD)
	{ var flag=false; 
	 var image=new Image(); 
	 image.src=ImgD.src; 
	 if(image.width>0 && image.height>0)
		{ flag=true; 
		  if(image.width/image.height>= 105/80)
			{ if(image.width>105)
				{ ImgD.width=105; 
				 ImgD.height=(image.height*105)/image.width; 
				 }
			   else{ ImgD.width=image.width;
				 ImgD.height=image.height; 
				   } 
				   ImgD.alt="点击查看详细信息..."; 
			  } 
		  else{ if(image.height>80)
				{ImgD.height=80; 
				 ImgD.width=(image.width*80)/image.height; 
				}
			else{ ImgD.width=image.width;
				 ImgD.height=image.height; 
				 } 
				 ImgD.alt="点击查看详细信息..."; 
			 } 
		 }
	}

function Marquee1(){
if(demo2.offsetWidth-demo.scrollLeft<=0)
demo.scrollLeft-=demo1.offsetWidth
else{
demo.scrollLeft++
}
}

function ting2008()
{
window.open("about:blank","ting2008","top=0,left=0,width=785, height=130,scrollbars=auto , noresize");
}
function Wmaplay(id){
window.open( '/music/play1/p.htm?'+id,'ting2008', ',width=785 , height=130 ,scrollbars=no , noresize');
}
function Wmaplay1(id){
window.open( '/music/play1/p1.htm?'+id,'ting2008', ',width=785 , height=130 ,scrollbars=auto , noresize');
}
function LyricSee(id)
{ 
window.open('showword.asp?id='+id,'musicword','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=yes,width=460,height=430,top=10,left=10'); 
}
function IFrameReSize(iframename) {

　　var pTar = document.getElementById(iframename);

　　if (pTar) {  //ff

　　if (pTar.contentDocument && pTar.contentDocument.body.offsetHeight) {

　　pTar.height = pTar.contentDocument.body.offsetHeight;

　　} //ie

　　else if (pTar.Document && pTar.Document.body.scrollHeight) {

　　pTar.height = pTar.Document.body.scrollHeight;

　　}

　　}

　　}

　　//iframe宽度自适应

　　function IFrameReSizeWidth(iframename) {

　　var pTar = document.getElementById(iframename);

　　if (pTar) {  //ff

　　if (pTar.contentDocument && pTar.contentDocument.body.offsetWidth) {

　　pTar.width = pTar.contentDocument.body.offsetWidth;

　　}  //ie

　　else if (pTar.Document && pTar.Document.body.scrollWidth) {

　　pTar.width = pTar.Document.body.scrollWidth;

　　}

　　}

　　}

function doPosition() {
two.style.top = document.all.one.offsetHeight/2 - two.offsetHeight/2;
two.style.left = document.all.one.offsetWidth/2 - two.offsetWidth/2;
// <iframe src=/login/inner.asp frameborder=0 marginheight=1 marginwidth=1 noResize scrolling=no allowTransparency="true" width=100 // height=30>
}
function countdown(secs){if(--secs>0)setTimeout("countDown("+secs+")",1000);}
