//*********************************************************
// Description : For get id
//*********************************************************
function $(id) {
	return document.getElementById(id);
}

//*********************************************************
// Description : For Popup
//*********************************************************
function popC(URL) {
	day = new Date();
	id = day.getTime();
	eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=no,scrollbars=yes,location=no,statusbar=yes,menubar=no,resizable=yes,width=900,height=800,left = 711,top = 476');");

}

//*********************************************************
// Description : Js for hide and show
//*********************************************************
function hideshow(id) {
	var stat=$(id).style.display;
	if(stat=="none") {
		$(id).style.display="";
	} else {
		$(id).style.display="none";
	}
}

//*********************************************************
// Description : For Trigger Function
//*********************************************************
function triggerCPF(func) {
	$('cmiframe').src="cpfunc.php?process="+func;
	window.location="#cmanager";
}

//*********************************************************
// Description : E-Mail Validation
//*********************************************************
function checkEmail(email) {
   var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
   if(reg.test(email) == false) {
      return false;
   } 
   return true;
}

//*********************************************************
// Description : Domain Name Control
//*********************************************************
function checkDomain(domain){
	var reg = /^([a-z0-9_\-])+\.([A-Za-z0-9_\-\.]){2,6}$/;
   if(reg.test(domain) == false) {
      return false;
   } 
   return true;
}

//*********************************************************
// Description : Username Validation
//*********************************************************
function checkUsername(username) {
   var reg = /^([A-Za-z0-9])+$/;
   if(reg.test(username) == false) {
      return false;
   } 
   return true;
}

//*********************************************************
// Description : Username Validation
//*********************************************************
function checkPassword(pass) {
   var reg = /^([A-Za-z0-9\%\-\_\.])+$/;
   if(reg.test(pass) == false) {
      return false;
   } 
   
   if(pass.length<6) {
   	  return false;
   }
   
   return true;
}

//*********************************************************
// Description : Form Submit
//*********************************************************
function frmSubmit(name) {
	document.forms[name].submit();
}

//*********************************************************
// Description : Image Process Show
//*********************************************************
function showProcessImg() {
	 $('processimg').style.display="";	
}
