
// JavaScript Document

// JavaScript Document



//validate login when submitted

function Validate(theForm){

	if (theForm.username.value == ''){

		alert('请键入电子邮件地址');

		theForm.username.focus();

		return false;

	}//end if

	url = theForm.username.value;

	a = url.lastIndexOf('@');

	b = url.lastIndexOf('.');

	o = 0;

	if (a > b) {o++};

	if (a == -1) {o++};

	if (b == -1) {o++};

	if (o == 0) {

		theForm.username.value=url;

	}else{

		alert('请键入正确电子邮件地址');

		theForm.username.focus();

		return false;

	}//end ifelse

		



	if (theForm.userPassword.value == ''){

		alert("请键入正确密码");

		theForm.userPassword.focus();

		return (false);

	}//end if	

	return true;

}//end function

function BankShippingValidateForm()

{
if ( document.rm.SSNAGREEMENT[0].checked == false  ) { 
		alert("주민등록번호 수집에 동의하지 않으시면 전환신청이 불가능합니다. ");
		//document.rm.SSNAGREEMENT.focus();

		return (false);

	}//end if


if (document.rm.BANKNAME.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.BANKNAME.focus();

		return (false);

	}//end if

if (document.rm.BANKACCOUNTNAME.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.BANKACCOUNTNAME.focus();

		return (false);

	}//end if

	

if (document.rm.BANKACCOUNTNUMBER.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.BANKACCOUNTNUMBER.focus();

		return (false);

	}//end if

if (document.rm.SSN1NEW.value == ''){

		alert("주민등록번호의 앞자리수를 입력해 주세요");

		document.rm.SSN1NEW.focus();

		return (false);

	}//end if

if (document.rm.SSN2NEW.value == ''){
		alert("주민등록번호의 뒷자리수를 입력해 주세요");
		document.rm.SSN2NEW.focus();
		return (false);
	}//end if

	if (document.rm.SSN1NEW.value.length != 6){
		alert("주민등록번호의 앞자리는 6자리 숫자로 입력해 주세요");
		document.rm.SSN1NEW.focus();
		return (false);
	}//end if

if (document.rm.SSN2NEW.value.length != 7){
		alert("주민등록번호의 뒷자리는 7자리 숫자로 입력해 주세요");
		document.rm.SSN2NEW.focus();
		return (false);
	}//end if

if(isNaN(document.rm.SSN1NEW.value))  {
    alert("주민등록번호는 숫자만 입력해 주세요");
	document.rm.SSN1NEW.focus();
	return (false);
}


if(isNaN(document.rm.SSN2NEW.value))  {
    alert("주민등록번호는 숫자만 입력해 주세요");
	document.rm.SSN2NEW.focus();
	return (false);
}

if(isNaN(document.rm.BANKACCOUNTNUMBER.value))  {
    alert("-> 계좌번호는 숫자만 입력해 주세요");
	document.rm.BANKACCOUNTNUMBER.focus();
	return (false);
}



if (document.rm.SSN1NEW.value != ''){
		var agree=confirm("귀하께서 입력해 주신 주민등록번호가  " + document.rm.SSN1NEW.value+"-"+document.rm.SSN2NEW.value+"이 면 '확인'버튼을 눌러주세요");
if (agree)
	return true ;
else
	alert ("취소하셨습니다. 재입력해주세요.");
	document.rm.SSN1NEW.focus();
	return (false);
	}//end if	
return true;
}//end function

function ShippingValidateForm()

{

	if (document.rm.DELIVERYZIP1_1.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.DELIVERYZIP1_1.focus();

		return (false);

	}//end if

	if (document.rm.DELIVERYZIP1_2.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.DELIVERYZIP1_2.focus();

		return (false);

	}//end if

	if (document.rm.DELIVERYZIPADDRESS1_1.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.DELIVERYZIPADDRESS1_1.focus();

		return (false);

	}//end if

	if (document.rm.DELIVERYZIPADDRESS1_2.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.DELIVERYZIPADDRESS1_2.focus();

		return (false);

	}//end if

	if (document.rm.DELIVERYZIPADDRESS1_3.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.DELIVERYZIPADDRESS1_3.focus();

		return (false);

	}//end if

	if (document.rm.ZIPADDRESS4.value == ''){

		alert("값을 입력하여 주십시오");

		document.rm.ZIPADDRESS4.focus();

		return (false);

	}//end if

	return true;

}//end function

//validate login when submitted

function Submit(theForm){

	if(Validate(theForm)){

		document.formLogin.submit();

	}//end if

}//end function



//show flash without frame

function loadFlash(flashName, flashWidth, flashHeight){

	var flashTag="";



	flashTag ="<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" ";

	flashTag+="codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0\" ";

	flashTag+="width=\""+flashWidth+"\" ";

	flashTag+="height=\""+flashHeight+"\">";

	flashTag+="<param name=\"movie\" value=\""+flashName+"\">";

	flashTag+="<param name=\"quality\" value=\"high\">";

	flashTag+="<param name=\"menu\" value=\"false\">";

	flashTag+="<PARAM NAME=wmode VALUE=transparent>";

	flashTag+="<embed src=\""+flashName+"\" width=\""+flashWidth+"\" height=\""+flashHeight+"\" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\">";

	flashTag+="</embed>";

	flashTag+="</object>";



	document.write(flashTag);

}



<!-- Hide JavaScript from Java-Impaired Browsers



/*function MenuRollOver(oTd) {if (!oTd.contains(event.fromElement)) {oTd.bgColor="#FFee66";}{oTd.Color="#FFFFFF";}}

function MenuRollOut(oTd) {if (!oTd.contains(event.toElement)) {oTd.bgColor="#FFFFFF";}}

*/



// End Hiding -->



//date

function makeArray(n) {

this.length = n

return this

}

monthNames = new makeArray(12)

monthNames[1] = "1"

monthNames[2] = "2"

monthNames[3] = "3"

monthNames[4] = "4"

monthNames[5] = "5"

monthNames[6] = "6"

monthNames[7] = "7"

monthNames[8] = "8"

monthNames[9] = "9"

monthNames[10] = "10"

monthNames[11] = "11"

monthNames[12] = "12"

function dateString(oneDate) {

var theMonth = monthNames[oneDate.getMonth() + 1]

var theYear = oneDate.getFullYear()

return theYear + "?" + theMonth + "?" + oneDate.getDate() + "? " 

}

//



function lib_bwcheck(){ 

	this.ver=navigator.appVersion

	this.agent=navigator.userAgent

	this.dom=document.getElementById?1:0

	this.opera5=this.agent.indexOf("Opera 5")>-1

	this.ie5=(this.ver.indexOf("MSIE 5")>-1 && this.dom && !this.opera5)?1:0; 

	this.ie6=(this.ver.indexOf("MSIE 6")>-1 && this.dom && !this.opera5)?1:0;

	this.ie7=(this.ver.indexOf("MSIE 7")>-1 && this.dom && !this.opera5)?1:0;

	this.ie4=(document.all && !this.dom && !this.opera5)?1:0;

	this.ie=this.ie4||this.ie5||this.ie6||this.ie7

	this.mac=this.agent.indexOf("Mac")>-1

	this.ns6=(this.dom && parseInt(this.ver) >= 5) ?1:0; 

	this.ns4=(document.layers && !this.dom)?1:0;

	this.bw=(this.ie7|| this.ie6 || this.ie5 || this.ie4 || this.ns4 || this.ns6 || this.opera5)

	return this

}

var bw=new lib_bwcheck()



var numScrollPages = 3  

var transitionOut = 1;      

var transitionIn = 2;       

var slideAcceleration = 0.2;  

var transitionOnload = 1   



var px = bw.ns4||window.opera?"":"px";



if(document.layers){ 

	scrX= innerWidth; scrY= innerHeight;

	onresize= function(){if(scrX!= innerWidth || scrY!= innerHeight){history.go(0)} }

}



// *********************** comment (kr) ***********************************

//function scrollerobj(obj,nest){

//	nest = (!nest)?"":'document.'+nest+'.'

//	this.elm = bw.ie4?document.all[obj]:bw.ns4?eval(nest+'document.'+obj):document.getElementById(obj)

//	this.css = bw.ns4?this.elm:this.elm.style

//	this.doc = bw.ns4?this.elm.document:document

//	this.obj = obj+'scrollerobj'; eval(this.obj+'=this')



//	this.x = (bw.ns4||bw.opera5)?this.css.left:this.elm.offsetLeft

//	this.y = (bw.ns4||bw.opera5)?this.css.top:this.elm.offsetTop

//	this.w = (bw.ie7||bw.ie4||bw.ie5||bw.ie6||bw.ns6)?this.elm.offsetWidth:bw.ns4?this.elm.clip.width:bw.opera5?this.css.pixelWidth:0

//	this.h = (bw.ie7||bw.ie4||bw.ie5||bw.ie6||bw.ns6)?this.elm.offsetHeight:bw.ns4?this.elm.clip.height:bw.opera5?this.css.pixelHeight:0

//}





//scrollerobj.prototype.moveTo = function(x,y){

//	if(x!=null){this.x=x; this.css.left=x+px}

//	if(y!=null){this.y=y; this.css.top=y+px}

//}

//scrollerobj.prototype.moveBy = function(x,y){this.moveTo(this.x+x,this.y+y)}

//scrollerobj.prototype.hideIt = function(){this.css.visibility='hidden'}

//scrollerobj.prototype.showIt = function(){this.css.visibility='visible'}

//

//var scrollTimer = null;

//function scroll(step){

//	clearTimeout(scrollTimer);

//	if ( !busy && (step<0&&activePage.y+activePage.h>scroller1.h || step>0&&activePage.y<0) ){

//		activePage.moveBy(0,step);

//		scrollTimer = setTimeout('scroll('+step+')',40);

//	}

//}

//function stopScroll(){

//	clearTimeout(scrollTimer);

//}

//

//var activePage = null;

//var busy = 0;

//function activate(num){

//	if (activePage!=pages[num] && !busy){

//		busy = 1;

//		if (transitionOut==0 || !bw.opacity){ activePage.hideIt(); activateContinue(num); }

//		else if (transitionOut==1) activePage.blend('hidden', 'activateContinue('+num+')');

//	}

//}

//function activateContinue(num){

//	busy = 1;

//	activePage = pages[num];

//	activePage.moveTo(0,0);

//	if (transitionIn==0 || !bw.opacity){ activePage.showIt(); busy=0; }

//	else if (transitionIn==1) activePage.blend('visible', 'busy=0');

//	else if (transitionIn==2) activePage.slide(0, slideAcceleration, 40, 'busy=0');

//}

//

//

//scrollerobj.prototype.slide = function(target, acceleration, time, fn){

//	this.slideFn= fn?fn:null;

//	this.moveTo(0,scroller1.h);

//	if (bw.ie4&&!bw.mac) this.css.filter = 'alpha(opacity=100)';

//	if (bw.ns6) this.css.MozOpacity = 1;

//	this.showIt();

//	this.doSlide(target, acceleration, time);

//}

//scrollerobj.prototype.doSlide = function(target, acceleration, time){

//	this.step = Math.round(this.y*acceleration);

//	if (this.step<1) this.step = 1;

//	if (this.step>this.y) this.step = this.y;

//	this.moveBy(0, -this.step);

//	if (this.y>0) this.slideTim = setTimeout(this.obj+'.doSlide('+target+','+acceleration+','+time+')', time);

//	else {	

//		eval(this.slideFn);

//		this.slideFn = null;

//	}

//}

//

//scrollerobj.prototype.blend= function(vis, fn){

//	if (bw.ie5||bw.ie6||bw.ie7 && !bw.mac) {

//		if (vis=='visible') this.css.filter= 'blendTrans(duration=0.9)';

//		else this.css.filter= 'blendTrans(duration=0.6)';

//		this.elm.onfilterchange = function(){ eval(fn); };

//		this.elm.filters.blendTrans.apply();

//		this.css.visibility= vis;

//		this.elm.filters.blendTrans.play();

//	}

//	else if (bw.ns6 || bw.ie&&!bw.mac){

//		this.css.visibility= 'visible';

//		vis=='visible' ? this.fadeTo(100, 7, 40, fn) : this.fadeTo(0, 9, 40, fn);

//	}

//	else {

//		this.css.visibility= vis;

//		eval(fn);

//	}

//};

//

//scrollerobj.prototype.op= 100;

//scrollerobj.prototype.opacityTim= null;

//scrollerobj.prototype.setOpacity= function(num){

//	this.css.filter= 'alpha(opacity='+num+')';

//	this.css.MozOpacity= num/100;

//	this.op= num;

//}

//scrollerobj.prototype.fadeTo= function(target, step, time, fn){

//	clearTimeout(this.opacityTim);

//	this.opacityFn= fn?fn:null;

//	this.op = target==100 ? 0 : 100;

//	this.fade(target, step, time);

//}

//scrollerobj.prototype.fade= function(target, step, time){

//	if (Math.abs(target-this.op)>step){

//		target>this.op? this.setOpacity(this.op+step):this.setOpacity(this.op-step);

//		this.opacityTim= setTimeout(this.obj+'.fade('+target+','+step+','+time+')', time);

//	}

//	else {

//		this.setOpacity(target);

//		eval(this.opacityFn);

//		this.opacityFn= null;

//	}

//}



//

//var pageslidefadeLoaded = 0;

//function initPageSlideFade(){

//	scroller1 = new scrollerobj('divScroller1');

//	

//	pages = new Array();

//	for (var i=0; i<numScrollPages; i++){

//		pages[i] = new scrollerobj('dynPage'+i, 'divScroller1');

//		pages[i].moveTo(0,0);

//	}

//	bw.opacity = ( bw.ie && !bw.ie4 && navigator.userAgent.indexOf('Windows')>-1 ) || bw.ns6

//	if (bw.ie5||bw.ie6||bw.ie7 && !bw.mac) pages[0].css.filter= 'blendTrans(duration=0.6)'; // Preloads the windows filters.

//	

//	if (transitionOnload) activateContinue(0);

//	else{

//		activePage = pages[0];

//		activePage.showIt();

//	}

//

//	if (bw.ie) for(var i=0;i<document.links.length;i++) document.links[i].onfocus=document.links[i].blur;

//	pageslidefadeLoaded = 1;

//}

//

//if(bw.bw && !pageslidefadeLoaded) onload = initPageSlideFade;

// *********************** comment (kr) ***********************************

//show/hide menu in privacy, faq, terms, etc

var old_menu = '';

function menuclick( submenu)

{

	if( old_menu != submenu ) {

		if( old_menu !='' ) {

			old_menu.style.display = 'none';

		}

		submenu.style.display = 'block';

		old_menu = submenu;



	} else {

		submenu.style.display = 'none';

		old_menu = '';

	}

}



//-->



//forbid right click

//function noRightClick(){

<!--

//	var message="";

/*

function clickIE() {if (document.all) {(message);return false;}}

function clickNS(e) {if 

(document.layers||(document.getElementById&&!document.all)) {

if (e.which==2||e.which==3) {(message);return false;}}}

if (document.layers) 

{document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS;}

else{document.onmouseup=clickNS;document.oncontextmenu=clickIE;}



document.oncontextmenu=new Function("return false")

*/

// --> 

//}



//function hidestatus(){

//	window.status=''

//	return true

//}



//if (document.layers)

//document.captureEvents(Event.MOUSEOVER | Event.MOUSEOUT)



//document.onmouseover=hidestatus

//document.onmouseout=hidestatus



//floatinglayer

function hideMe(){

floatingLayer.style.visibility="hidden";

}





 var bSupportedBrowser;

      if (document.getElementById)

      {

      bSupportedBrowser = true;

      document.write('<style type="text/css">');

        document.write('.hideMe {display: none;}');

        document.write('.showMe {display: block;}');

        document.write('</style>');

      }

      





function disp_text()
   {   
   
   var w = document.rm.MANYCHILDREN.selectedIndex;
 
   showContent(w);
		    	
   }

	function showContent(i)
	{

       for(var counter=2;counter<document.rm.MANYCHILDREN.length;counter++)
		{
		
		if (counter <= i)
		 {
		 
		   var  YearControl = 'CHILD' + (counter-1) + 'YEAR_S2';
		   var  MonthControl = 'CHILD' + (counter-1) +'MONTH_S1';
		   
    	   document.getElementById(YearControl).className = 'showMe';
		   document.getElementById(MonthControl).className = 'showMe';
		  
		 }
        else
		  {

		   var  YearControl = 'CHILD' + (counter-1) + 'YEAR_S2';
		   var  MonthControl = 'CHILD' + (counter-1) +'MONTH_S1';
           
           
            eval('document.rm.'+YearControl).selectedIndex = 0;
		    eval('document.rm.'+MonthControl).selectedIndex = 0;
		   
		   document.getElementById(YearControl).className = 'hideMe';
		   document.getElementById(MonthControl).className = 'hideMe';
	       

		  }
		}
		
	}

function joinLoad()
{
if(document.getElementById('MANYCHILDREN') != null)
disp_text();

}




