	

	function changeDivDisplay(divName1, divName2) {
		document.getElementById(divName1).style.display = "none";
		document.getElementById(divName2).style.display = "";
	}
	

	function toBreakWord(intLen, objName){
		if (document.getElementById && !document.all) {
			var obj=document.getElementById(objName);
			var strContent=obj.innerHTML;  
			var strTemp="";
			var intLineLength = 0;
			var bolHtmlFlag = false;
			for (var i = 0; i < strContent.length; i = i + 1){
				if (i < strContent.length - 3 && strContent.substr(i, 4).toUpperCase() == "<BR>") {
					intLineLength = -3;
				}
				else{
				    if (strContent.substr(i, 1) == "<") {
				    	bolHtmlFlag = true;
				    }
				 	if (!bolHtmlFlag) {
						intLineLength = intLineLength + 1;
					}
					if (strContent.substr(i, 1) == ">"){
				    	bolHtmlFlag = false;
				    }
				}
				if (intLineLength > intLen) {
					strTemp += "<BR>";
					intLineLength = 1;
				}
				strTemp += strContent.substr(i, 1);
			}
			obj.innerHTML=strTemp;
		}
	}
	var tmpMenu1="";//menu1
	var tmpMenu2="";//menu2
	var tmpMenu3="";//menu3
	var tmpMenu2Color="";//

	function   getTop(cell){ 
		//alert(cell);
	    var   t=cell.offsetTop;  
	    while(cell=cell.offsetParent){   
	      t+=cell.offsetTop;  
	    } 
	    return   t;   
	  }

	  function getWitdh(cell){ 
		
	    var   t=cell.offsetLeft + cell.offsetWidth;  
	    while(cell=cell.offsetParent){   
	      t+=cell.offsetLeft;  
	    } 
		
	    return   t;   
	  } 

	function onMenuItemOver(divName1,divName2,divA){
		var clinetY="0";
		var objA=document.getElementById(divA);
		if(objA!=null){
			clinetY=getTop(objA);
		}
		if(document.getElementById(tmpMenu1)!=null)
		{
			document.getElementById(tmpMenu1).style.display = "none";
		}
		if(document.getElementById(tmpMenu2)!=null){
			document.getElementById(tmpMenu2).style.display = "none";
		}
		if(document.getElementById(tmpMenu3)!=null){
			document.getElementById(tmpMenu3).style.display = "none";
		}
		var obj=document.getElementById(divName1);	
		if(obj!=null){
			if(objA!=null){
				obj.style.left =getWitdh(objA);
			}
			else{
				obj.style.left ="20";
			}
			obj.style.top =clinetY;
			obj.style.display = "";
			tmpMenu1=divName1;		
		}
	}

	function onMenuItem2Over(divName1,divName2,divA){	
		var clinetY= "0";
		var objA=document.getElementById(divA);
		if(document.getElementById(tmpMenu3)!=null){
			document.getElementById(tmpMenu3).style.display = "none";
		}
		if(document.getElementById(divName1)!=null){
			clinetY=getTop(document.getElementById(divName1));
			document.getElementById(divName1).className="clsOnmouseOver";
			if(document.getElementById(tmpMenu2Color)!=null)
			{
				document.getElementById(tmpMenu2Color).className="clsOnmouseOut";
			}
			tmpMenu2Color=divName1;
		}
		var obj=document.getElementById(divName2);
		if(obj!=null){
			obj.style.left =(document.getElementById(divA)!=null?getWitdh(document.getElementById(divA)):0 )+ (document.getElementById(divName1)!=null?document.getElementById(divName1).offsetWidth:80 );
			obj.style.top =clinetY;
			obj.style.display = "";
			tmpMenu3=divName2;
	
		}
	}



	function onMenuItemOut(){	
		setTimeout("hidDiv()",500);
	}

	function hidDiv(){
		if(document.getElementById(tmpMenu1)!=null)
		{
			document.getElementById(tmpMenu1).style.display = "none";
		}
		if(document.getElementById(tmpMenu2)!=null){
			document.getElementById(tmpMenu2).style.display = "none";
		}
		if(document.getElementById(tmpMenu3)!=null){
			document.getElementById(tmpMenu3).style.display = "none";
		}
	}

	function getByteCount(str) {
		var ret = 0;
		for (var i = 0; i < str.length; i = i + 1) {
			var c = str.charCodeAt(i);
			if (c < 256 || (c >= 0xff61 && c <= 0xff9f)) {
				ret = ret + 1;
			}
			else{
				ret = ret + 2;
			}
		}
		return ret;
	}

 function chkemail(strMail,mailLeng)
 {
     if (isEmpty(strMail) ||  strMail.length > mailLeng){
		return false;
     }
	var regu = "^(([0-9a-zA-Z]+)|([0-9a-zA-Z]+[_.0-9a-zA-Z-]*))@([a-zA-Z0-9-]+[.])+([a-zA-Z]{2}|net|NET|com|COM|gov|GOV|mil|MIL|org|ORG|edu|EDU|int|INT)$"
	var re = new RegExp(regu);
	if (strMail.search(re) != -1) {
		return true;
	} else {	
	return false;
	}
 }

 function fucCheckSTR(NUM)
 {
    var i,j,strTemp;
    strTemp="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ_";
    if ( NUM.length== 0)
        return 0
    for (i=0;i < NUM.length;i++)
    {
       j=strTemp.indexOf(NUM.charAt(i));
       if (j==-1)
       {
         return 0;
       }
    }
    return 1;
 } 

 function isEmpty(value){
		if(value === null || value===''){
			return true;
		}
		return false;
	}
	
	//Check first name
	function isFirstName(value,intLeng){
		if(value === null || value === ''){
			return false;
		}
		if(getByteCount(value)>intLeng){
			return false;
		}
		var value2;
		for(var i=0;i<value.length;i = i + 1){
			value2=value.slice(i,i+1);
			if(value2.search(/[A-Z.\s+|\sa-z]/)<0){
				return false;
			}
		}
		return true;
	}
	
	//Check last name
	function isLastName(value,intLeng){
		if(value === null || value === ''){
			return false;
		}
		if(getByteCount(value)>intLeng){
			return false;
		}
		var value2;
		for(var i=0;i<value.length;i = i + 1){
			value2=value.slice(i,i+1);
			if(value2.search(/[A-Za-z]/)<0){
				return false;
			}
		}
		return true;
	}
	

	function isAlphabetHalfWidth(value){
		if(value === null || value === ''){
			return true;
		}
		var value2;
		for(var i=0;i<value.length;i = i + 1){
			value2=value.slice(i,i+1);
			if(value2.search(/[A-Z\s+|\s\-a-z0-9]/)<0){
				return false;
			}
		}
		return true;
	}
	
	function isPostCode(value,intLeng){
	if(value === null || value === ''){
			return true;
		}
		if(getByteCount(value)>intLeng){
			return false;
		}
		var value2;
		for(var i=0;i<value.length;i = i + 1){
			value2=value.slice(i,i+1);
			if(value2.search(/[0-9\-]/)<0){
				return false;
			}
		}
		return true;
	}

	function isSymbolHalfWidth(value){
	    if ( value === null || value === ""){
	        return true;
		}
		var symbolHalf = " `~!@#$%^&*()_+|\\=-{}\":?><,./;'[]";
	    for (i=0;i<value.length;i = i + 1)
	    {
	       j=symbolHalf.indexOf(value.charAt(i));
	       if (j==-1)
	       {
	         return false;
	       }
	    }
	    return true;
	}

	function isDigitandAlphabetHalfWidth(value){
		if(value === null || value === ''){
			return true;
		}
		var value2;
		for(var i=0;i<value.length;i = i + 1){
			value2=value.slice(i,i+1);
			if(value2.search(/[A-Za-z0-9]/)<0){
				return false;
			}
		}
		return true;
	}

	function isHankaku(value) {
		if ( value === null || value === ""){
	        return true;
		}
		var value2;
	    for (var i=0;i<value.length;i = i + 1){
	       value2=value.slice(i,i+1);
	       if(!isDigitandAlphabetHalfWidth(value2) && !isSymbolHalfWidth(value2)){
	           return false;
	       }
	    }
	    return true;
	}

	function openDetailImg(img, width, height) {
		if (width == "0" || height == "0") {
			return;
		}
		if (width > screen.width){
			height = parseInt(height)+16;
			width = screen.width;
			window.open('PegA801001.do?method=showThingInfo&strImage=' + img, '', 'height=' + height + ', width=' + width + ', toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			return;
		}
		if (height > screen.height){
			width = parseInt(width)+16;
			height = screen.height
			window.open('PegA801001.do?method=showThingInfo&strImage=' + img, '', 'height=' + height + ', width=' + width + ', toolbar=no, menubar=no, scrollbars=yes, resizable=no,location=no, status=no');
			return;
		}
		window.open('PegA801001.do?method=showThingInfo&strImage=' + img, '', 'height=' + height + ', width=' + width + ', toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');
	}