

String.prototype.trim = function()
{
	return this.replace(/(^\s*)|(\s*$)/gi, "");
}


function pop( url, width, height, flag ) {
    if ( flag == "0" )
		window.open( url, "", "toolbar=0,menubar=0,scrollbars=no,resizable=no,width=" + width + ",height=" + height + ";");
    else 
		window.open( url, "", "toolbar=0,menubar=0,scrollbars=yes,resizable=no,width=" + width + ",height=" + height + ";");
}


function isNumeric(str) { 
    var r = new RegExp("^[0-9]+$"); 
    return r.test(str);
}


function isAlphaNumeric( str ) {
    for ( var i = 0; i < str.length; i++ ) {
        if ( !( str.charAt( i ) >= '0' && str.charAt( i ) <= '9' ) &&
                !( str.charAt( i ) >= 'a' && str.charAt( i ) <= 'z' ) &&
                !( str.charAt( i ) >= 'A' && str.charAt( i ) <= 'Z' ) )
            return false;
    }
    
    return true;
}

function isEmail(str) { 
    var r1 = new RegExp("(@.*@)|(\\.\\.)|(@\\.)|(^\\.)"); 
    var r2 = new RegExp("^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$"); 
    return (!r1.test(str) && r2.test(str)); 
} 


function isPhone(str) { 
    var r = new RegExp("^[0-9]{2,4}-[0-9]{2,4}-[0-9]{4,4}$"); 
    return r.test(str); 
} 








// 이메일수신폼
function popEmail() {
	var positionX = (screen.width-637)/2;
	var positionY = (screen.height-520)/2;
	window.open("/jpn_ip/etc/popup_email.asp","Email_Service","left="+positionX+",top="+positionY+",width=637,height=520,toolbar=no,scrollbars=yes" );
}

// RP레이어쇼
function chgRP_over(nidNum){
	for (i=1;i<5;i++){
		document.getElementById('rp_mn' + i).src = "/jpn_ip/images/common/rp_menu0"  + i + "_off.gif"; 
		document.getElementById('rp_mn_alt' + i ).style.visibility="hidden";
		document.getElementById('rp_mn_alt' + i ).style.display="none";
	}
	
	document.getElementById('rp_mn' + nidNum).src = "/jpn_ip/images/common/rp_menu0"  + nidNum+ "_on.gif"; 
	document.getElementById('rp_mn_alt' + nidNum ).style.visibility="visible";
	document.getElementById('rp_mn_alt' + nidNum ).style.display="";
}

function chgRP_out(nidNum){
	document.getElementById('rp_mn' + nidNum).src = "/jpn_ip/images/common/rp_menu0"  + nidNum + "_off.gif"; 
	document.getElementById('rp_mn_alt' + nidNum).style.visibility="hidden";
	document.getElementById('rp_mn_alt' +nidNum).style.display="none";
}

function chgRP_balloon(nidNum){
	for (i=1;i<5;i++){
		document.getElementById('rp_balloon' + i ).style.visibility="hidden";
		document.getElementById('rp_balloon' + i ).style.display="none";
	}
	 
	document.getElementById('rp_balloon' + nidNum ).style.visibility="visible";
	document.getElementById('rp_balloon' + nidNum ).style.display="";
}

// Flash Load
function flash(flashid, flashfilename, flashwidth, flashheight, flashvars, flashwmode) {
	document.write('<object id="' + flashid + '" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0" width="'+ flashwidth +'" height="'+ flashheight +'">');
	document.write('<param name="allowScriptAccess" value="always" />');
	document.write('<param name="movie" value="'+ flashfilename +'">');
	if (flashvars) document.write('<param name="flashVars" value="'+ flashvars +'">');
	document.write('<param name="wmode" value="'+ flashwmode +'">');
	document.write('<embed wmode="transparent" name="' + flashid + '"');
	if (flashvars) document.write(' flashVars="'+ flashvars +'" ');
	document.write(' src="'+ flashfilename +'" width="'+ flashwidth +'" height="'+ flashheight +'" ');
	document.write(' allowScriptAccess="always" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" >');
	document.write('</embed>');
	document.write('</object>');
}

// language Layer
function lang_sh(str){
	if(str == "s") {
		document.getElementById('lang_layer').style.visibility = "visible";
		document.getElementById('lang_layer').style.display = "block";
	} else {
		document.getElementById('lang_layer').style.visibility = "hidden";
		document.getElementById('lang_layer').style.display = "none";
	}
}


// GNB Link
function jpn_ip(num){ //
	
	if (num =='1'){ // bkl IP Group
	location.href = ("/jpn_ip/about/overview.asp");
	}
	
	else if (num =='2'){ //업무분야
	location.href = ("/jpn_ip/practice/all_list_type01.asp");
	}
	
	else if (num =='3'){ //구성원
	location.href = ("/jpn_ip/prof/all_list.asp");
	}
	
	else if (num =='4'){ // 자료실
	location.href = ("/jpn_ip/publication/newsletter.asp");
	}
	
	else { //인재채용
	location.href = "/jpn_ip/recruit/info.asp";
	}
	
}


// 
function initMenu(currPage, currMenuNum) {
   var menuCount;
   var menuAbout;

   switch (currPage)
   {

	case "0":
	   menuCount=2;
       menuName = "about";
	   break;
    case "1":
	   menuCount=1;
       menuName = "practice";
	   break;
    case "2":
	   menuCount=5;
       menuName = "prof";
	   break;
    case "3":
	   menuCount=6;
       menuName = "publication";
	   break;
    case "4":
	   menuCount=1;
       menuName = "recruit";
	   break;
	case "11":
       menuCount=3;
       menuName = "center";
	   break;
   
   }
   
   for(i=1;i <= menuCount;i++){
     if (i==currMenuNum)
     {
        document.getElementById('menu' + i).src = "/jpn_ip/images/"+menuName+"/left_menu0"  + i + "_on.gif"; 	 
     }
	 else {
		document.getElementById('menu' + i).src = "/jpn_ip/images/"+menuName+"/left_menu0"  + i + "_off.gif"; 	 
	 }

   }

}


