// JScript source code
// Used to check input text's value adn show msgbox
    function CheckInputText(obj,msg){
        if(obj.value==""){
            alert(msg);            
            obj.focus();
            return false;
        }else{
            return true;
        }
    }
    function CheckEnter(){
		if(window.event.keyCode==13)
			return true;
		else
			return false;
    }
    
    function OpenWindow(urlname,otherref){
		if (otherref==null||otherref=="")
			otherref="toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=480,left=200,top=100";
			window.open(urlname,'one',otherref);
			
    }
	    function OpenWindow_xu(urlname,otherref){
		if (otherref==null||otherref=="")
			otherref="toolbar=yes,location=yes,resizable=yes,scrollbars=yes,height=800,width=600";
			window.open(urlname,'one',otherref);
			
    }

    
    function AddTableRow(tablename,rown)
    {
    	var Num,p,myrow,indexnewrow;    	
    	myrow=document.all(tablename).insertRow();
    	indexNewrow=document.all(tablename).rows.length-1;
    	
    	document.all(tablename).rows(indexNewrow).insertCell();
    	document.all(tablename).rows(indexNewrow).insertCell();    	
   
    	document.all(tablename).rows(indexNewrow).cells(0).innerHTML="<input type=button class=buttonface value=节点"+rown+">&nbsp;" ;
    	document.all(tablename).rows(indexNewrow).cells(1).innerText="I saw you"+rown+"";    	    	
    	
    }    
    
    //************************************************************************************************
//去处两边空格
//************************************************************************************************
function Trim(Str)
{
	try
	{
		var Beg = /\S/g; //建立正则表达式
		MatchArr = Str.match(Beg);//建立一个符合的
		BPos = Str.indexOf(MatchArr[0]);//确定开始为止
		EPos = Str.lastIndexOf(MatchArr[MatchArr.length-1]);//确定结束为止
		Str = Str.substring(BPos,EPos+1);//截取字符
		return Str;
	}
	catch(e)
	{
		return "";
	}
}
//****

//*****************************
//Set default value of a select area
//******************************
function SetDefaultSelect(selectobj,selectvalue){
    if(selectvalue!=""){
        for (i=0;i<selectobj.length;i++){
            if(selectobj(i).value==selectvalue){
                selectobj.selectedIndex=i;
                return;
            }
        }
    }
}
//*****************************

function AddLanmuShow(regionname){
	var tmp="";
	tmp=regionname;
    OpenWindow("../../coms/SelectLanmuType.php?regionname="+regionname,"");
}

function AddShow(regionname,areatype,imgurl){
	var tmpurl="";	
	otherref="";
	switch(areatype){
		case 1:
			tmpurl="../../siteadmin/AddShow.php?regionname="+regionname;
			break;
		case 2:
			tmpurl="../../coms/AddImgTxtRL.php?regionname="+regionname+"&defaultimgurl="+imgurl;			
			otherref="toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=680,left=200,top=100";
			break;
	}
    OpenWindow(tmpurl,otherref);
}

function ShowLanmuProperty(flowid,lanmutype){
       var otherref="";
       var tourl="";
       switch(lanmutype){
            case 1:
                tourl="../../coms/LanmuProperty.php?flowid="+flowid;
                break;
            case 3:
                tourl="../../coms/UpdateFriendLinkArea.php?flowid="+flowid;
                break;
			case 4:
				tourl="../../coms/UpdateFlashArea.php?flowid="+flowid;
				break;
			case 5:
				tourl="../../coms/UpdateFreeArea.php";
				break;
			case 6:
				tourl="../../coms/UpdateBottomArea.php";
				otherref="toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100";				
				break;		
			case 7:
				tourl="../../coms/UpdateProductShowArea.php?flowid="+flowid;
				break;	
			case 8:
				tourl="../../coms/updateCopyRight.php";
				otherref="toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100";
				break;
	    	case 17:
				tourl="../../coms/UpdateProductShowAreaB.php?flowid="+flowid;
				otherref="toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100";
				break;	
       }       
       OpenWindow(tourl,otherref);   
}
function ShowImageTextProperty(flowid){
	otherref="toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100";	
	OpenWindow("../../coms/UpdateImgTxtRL.php?flowid="+flowid,otherref);
}

function ShowMenuProperty(){	
	OpenWindow("../../coms/UpdateMenu.php","");
}
function ShowMenuEdit(){	
	OpenWindow("../../siteadmin/lanmumanagement.php","toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=780,left=200,top=100");
}
function SetBullet(){	
	OpenWindow("../../siteadmin/BulletinManagement.php","toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=680,left=200,top=100");
}
function SetCopyRight()
{
	OpenWindow("../../coms/updateCopyRight.php","toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100");

}
function SetFriendLink()
{
	OpenWindow("../../siteadmin/friendlinkmanagement.php","toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100");

}
function SetCounter()
{
  	OpenWindow("../../siteadmin/CounterManagement.php","toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100");

}
function SetMember()
{
  	OpenWindow("../../siteadmin/SubUserManagement.php","toolbar=no,location=no,resizable=no,scrollbars=yes,height=500,width=640,left=200,top=100");

}
function ShowHeaderProperty(siteid){
    OpenWindow("../../coms/UpdateHeader.php?siteid="+siteid,"");
}

function ShowProperty(flowid,areatype){
}

function GoToFriendLink(selname){
    if(document.all(selname).value!="-1"){
        window.location.href=document.all(selname).value;
    }
}
function write_xu(aaID)
{
	if(document.all(aaID).style.display=="none")
		document.all(aaID).style.display="";
	else
		document.all(aaID).style.display="none";
}


function PreviewWebSite(siteid){
	var tmp="http://www.869869.com/finalbestwishes/siteadmin/gopreview.php?siteid="+siteid;
	window.open(tmp,'','');
}


function isString(Str)
{
	var Check = /\W/;
	if(!Str.match(Check))
	{
		return true;
	}
	else
	{
		return false;
	}
}   
