//2011.04.05      Park Dong Ju        [CSR ID:1851413]  C20110328_51413
//2011.05.12      JaeHoon Noh         LG World 2.0 - f_c_signInDiv_open_onload (Double Point Event Start)
//js function
//menu
function fn_menu_click(url, mncd1, mncd2, mncd3){

	if(url == ""){ return; }
	document.menuForm.mncd1.value = mncd1;
	document.menuForm.mncd2.value = mncd2;
	document.menuForm.mncd3.value = mncd3;

	var ssurl = document.location;
	document.menuForm.back.value = ssurl;

	document.menuForm.target = "_self";
	document.menuForm.action = url;
	document.menuForm.submit();
}


// Sign In script start
// Sign 
function f_c_signIn(){

	var url = "";
	var sinId = document.getElementById("sin_id").value.trim();
	var sinPw = document.getElementById("sin_pw").value.trim();
	document.getElementById("errorIdMsg").innerHTML = "";
	document.getElementById("errorIdMsg").className = "";
	document.getElementById("errorPassMsg").innerHTML = "";
	document.getElementById("errorPassMsg").className = "";

	if( sinId == "" ){
		document.getElementById("sin_id").focus();

		document.getElementById("errorIdMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_enterid;
		document.getElementById("errorIdMsg").className = "si_warning";	
		return;
	}

	if( sinPw == "" ){
		document.getElementById("sin_pw").focus();

		document.getElementById("errorPassMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_enterpass;
		document.getElementById("errorPassMsg").className = "si_warning";
		return;
	}

	document.getElementById("errorIdMsg").innerHTML = "";
	document.getElementById("errorIdMsg").className = "";
	document.getElementById("errorPassMsg").innerHTML = "";
	document.getElementById("errorPassMsg").className = "";

 
	if(g_confLoginData == 'true') {
		url = g_signInAjaxSSLUrl;	// ssl	//--cjy
	} else {
		url = g_signInAjaxPlainUrl;	// none ssl	//--cjy
	}
	document.getElementById("sin_id").value = sinId;
	document.getElementById("sin_pw").value = sinPw;
	document.n_signIn.action = url;
	document.n_signIn.target = "top_login_frame";
	document.n_signIn.submit();

}

// Sign end
function resultReturn(isLogin ,encodedId ,ricDupFlag, privacyFlag){
	var loginOpen	=	g_loginOpen;
	var sTargetURL	=	g_sTargetURL;
	var rTargetURL	=	g_rTargetURL;
	var mncd1	=	g_pre_mncd1;
	var mncd2	=	g_pre_mncd2;
	var mncd3	=	g_pre_mncd3;
	
	var urlDev = "";

	if(loginOpen == "Y"){
		urlDev = sTargetURL;
		document.getElementById("pre_mncd1").value = mncd1;
		document.getElementById("pre_mncd2").value = mncd2;
		document.getElementById("pre_mncd3").value = mncd3;
		document.getElementById("loginOpen").value  = "";
	}else{
		urlDev = location.href;
		document.getElementById("pre_mncd1").value = g_menuInfo.rcv_mncd1;
		document.getElementById("pre_mncd2").value = g_menuInfo.rcv_mncd2;
		document.getElementById("pre_mncd3").value = g_menuInfo.rcv_mncd3;
	}

	if(isLogin == "Y"){
	   if(urlDev == "")urlDev  = "web.main.dev";
	
		document.hiddenForm.action = urlDev;
		saveid(document.n_signIn);	
		document.hiddenForm.submit();
		
	}else{
	    //Ric Duplicated Check 
       if(ricDupFlag != "" && ricDupFlag != null){
           document.dupFlagCheckForm.ricDupFlag.value = ricDupFlag;
           document.dupFlagCheckForm.dupSeqNo.value = encodedId;
           
           f_c_signInDimDiv("signInDiv", "signDupFlagCheckDiv");
           return;
       }else{
    	   if(privacyFlag == null || privacyFlag == "Y"){
    		   document.privacyCheckForm.privacyId.value = encodedId;
    		   f_c_signInDimDiv("signInDiv", "privacyCheckDiv");
    		   return;
    	   }else{
    		   document.getElementById("errorIdMsg").innerHTML = "";
    		   document.getElementById("sin_id").focus();
    		   document.getElementById("errorPassMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_invalididpass;
    		   document.getElementById("errorPassMsg").className = "si_warning";
    	   }//privacy check
       }
	}
}

// signin page
function f_c_signInDiv_open_onload(){

	var loginOpen = g_loginOpen;	//--cjy
	if(loginOpen == "Y"){	
		f_c_signInDiv_open();
	}

	var appl_section = g_appl_section;	//--cjy

	// Wish List
	if( appl_section == "WH" ){

		var mncd1 = g_mncd1;	//--cjy
		var applId = g_applId;	//--cjy

		f_c_addToWish(mncd1, applId);
	}
	
	// download
	if( appl_section == "FR" || appl_section == "BY" || appl_section == "DW" || appl_section == "DWL" || appl_section == "WSL"){

		//by ish 2010.12.10	 mncd1
		//var mncd1 = "<%=StringUtil.strTagToHtmlPrint(StringUtil.objToStr(request.getParameter("mncd1")))%>";	//--cjy
		var applId = g_applId;	//--cjy
		var accountTypeAjax = new getAccountTypeAjax(applId);
		
		if(accountTypeAjax.accountType === 'PD'){
		      f_c_download(applId, 'FR', mncd1, '');
		}else{
		      f_c_download_after(applId, appl_section);
		}
	}
	
	if( appl_section == "PH" ){

		var mncd1 = g_mncd1;	//--cjy
		var applId = g_applId;	//--cjy
		
		f_goPhoneClentMessage();
	}
	
	if( appl_section == "AH" ){

		var mncd1 = g_mncd1;	//--cjy
		var applId = g_applId;	//--cjy
		
		f_goAndroidMessage();
	}
}

// Sign Layer Popup 
function f_c_signInDimDiv(close, show){

	if( close != "" ){
		neoClose(close);
	}

	if( show == "signInDiv" ){
		f_c_signInDiv_open();
	//login
	}else if( show == "signInForgotIdDiv" ){
	//id find
		f_c_forgotUserIdLayerPopDiv_open(show);
	}else if( show == "signInForgotIdResultDiv" ){
	//id find Result.
		f_c_signInForgotIdResultDiv_open(show);
	}else if( show == "signInForgotPasswordDiv" ){
	//password find.
		f_c_signInForgotPasswordDiv_open(show);
	}else if( show == "signInForgotPasswordResultDiv" ){
	//password find Result.
		signInForgotPasswordResultDiv_open(show);
	}else if( show == "lgMobileMsgDiv" ){
    //LG Mobile Msg
        neoDim("lgMobileMsgDiv");
    }else if( show == "signDupFlagCheckDiv" ){
        neoDim("signDupFlagCheckDiv");
    }else if ( show == "privacyCheckDiv" ){
    //privacy check
    	neoDim("privacyCheckDiv");
    }

}

// User ID Find LayerPop 
function f_c_forgotUserIdLayerPopDiv_open(show){
	neoDim(show);

	document.getElementById("forgotIdEmail").value = "";

	document.getElementById("forgetIdErrMsg").innerHTML = "";
	document.getElementById("forgetIdErrMsg").className = "";
	
	window.setTimeout("document.getElementById('forgotIdEmail').focus();",1);
}

// User ID Find Ajax 
function f_c_forgotUserIdLayerPopDiv_send(){
    
    var email = document.getElementById("forgotIdEmail").value.trim();

    document.getElementById("forgetIdErrMsg").innerHTML = "";
    document.getElementById("forgetIdErrMsg").className = "";

    if( email == "" ){
        document.getElementById("forgotIdEmail").focus();
        document.getElementById("forgetIdErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_enteremailaddr;
        document.getElementById("forgetIdErrMsg").className = "si_warning";
        return;
    }
    
    if(!f_c_validateEmail(email)){
        document.getElementById("forgotIdEmail").focus();
        document.getElementById("forgetIdErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_emailformatvalid;
        document.getElementById("forgetIdErrMsg").className = "si_warning";
        return;
    }
    
    var idCheck = "";
    var myAjax = new Ajax.Request(
        'web.member.ForgotUserSendAjax.dev',
        {
            method : 'POST',
            parameters : {"email" : email
            },
            onComplete : function(request) { 
                var obj = f_c_getJSONObj(request.responseXML);
                idCheck = obj.body.idCheck;
                
                if( idCheck == "Y" ){
                    f_c_signInDimDiv("signInForgotIdDiv", "signInForgotIdResultDiv");
                }else{
                    document.getElementById("forgetIdErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_emailvalid;
                    document.getElementById("forgetIdErrMsg").className = "si_warning";
                }

            },
            onFailure : function() {
                var str = '';
                str += 'f_c_forgotUserIdLayerPopDiv_send()' + '\n';
                str += 'Failuer' + '\n';
                alert(str);
            },
            asynchronous : false
        }
    );

}

// User ID Find Ajax Result 
function f_c_signInForgotIdResultDiv_open(show){
	neoDim(show);
	var userId = document.getElementById("findUserId").value;

	document.getElementById("findIdMsg").innerHTML = g_finduserid.replace("userId",userId);
	document.getElementById("findIdMsg").className = "id_name";

}

function f_c_signInForgotPasswordDiv_open(show){
	neoDim(show);

	document.getElementById("forgotPassUserId").value = "";
    document.getElementById("forgotPassEmail").value = ""; 

    document.getElementById("forgetPassErrMsg").innerHTML = "";
    document.getElementById("forgetPassErrMsg").className = "";

    document.getElementById("forgetPassEmailErrMsg").innerHTML = "";
    document.getElementById("forgetPassEmailErrMsg").className = "";
    
    window.setTimeout("document.getElementById('forgotPassUserId').focus();",1);
}

// User Password Find Ajax 
function f_c_forgotUserPassLayerPopDiv_send(){

	var email = document.getElementById("forgotPassEmail").value.trim();
    var userId = document.getElementById("forgotPassUserId").value.trim();

    document.getElementById("forgetPassEmailErrMsg").innerHTML = "";
    document.getElementById("forgetPassEmailErrMsg").className = "";

    document.getElementById("forgetPassErrMsg").innerHTML = "";
    document.getElementById("forgetPassErrMsg").className = "";

    if( userId == "" ){
        document.getElementById("forgotPassUserId").focus();
        document.getElementById("forgetPassErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_enteruserid;
        document.getElementById("forgetPassErrMsg").className = "si_warning";
        return;
    }
    
    if( email == "" ){
        document.getElementById("forgotPassEmail").focus();
        document.getElementById("forgetPassEmailErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_enteremailaddr;
        document.getElementById("forgetPassEmailErrMsg").className = "si_warning";
        return;
    }
    
    if(!f_c_validateEmail(email)){
        document.getElementById("forgotPassEmail").focus();
        document.getElementById("forgetPassEmailErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_emailformatvalid;
        document.getElementById("forgetPassEmailErrMsg").className = "si_warning";
        return;
    }

    var idCheck = "";

    var myAjax = new Ajax.Request(
        'web.member.ForgotPasswordSendAjax.dev',
        {
            method : 'POST',
            parameters : {"email" : email, 
                          "userId" : userId
            },
            onComplete : function(request) {
                var obj = f_c_getJSONObj(request.responseXML);
                //userId = obj.body.userId;
                idCheck = obj.body.idCheck;

                if( idCheck == "Y" ){
                    f_c_signInDimDiv("signInForgotPasswordDiv", "signInForgotPasswordResultDiv");
                }else if(idCheck == "N"){
                    document.getElementById("forgetPassEmailErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_idnotmatch;
                    document.getElementById("forgetPassEmailErrMsg").className = "si_warning";
                }else if(idCheck == "ID"){
                    document.getElementById("forgetPassErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_idformatvalid;
                    document.getElementById("forgetPassErrMsg").className = "si_warning";
                }else if(idCheck == "EM"){
                    document.getElementById("forgetPassEmailErrMsg").innerHTML = "<img src=\""+g_erroricon01+"\" alt=\"caution\" /> " + g_emailvalid;
                    document.getElementById("forgetPassEmailErrMsg").className = "si_warning";
                }

            },
            onFailure : function() {
                var str = '';
                str += 'f_c_forgotUserPassLayerPopDiv_send()' + '\n';
                str += 'Failuer' + '\n';
                alert(str);
            },
            asynchronous : false
        }
    );

}

// Password Init Ajax Result 
function signInForgotPasswordResultDiv_open(show){
	neoDim(show);
}

// Sign In script end 

// Right Wing Link start
function f_c_RingWingLink(url){

	var _form = document.createElement("form");
	_form.id = "registerFrm";

	_form.name = "registerFrm";
	_form.method = "post";
	_form.action = url;
	document.body.appendChild(_form);
	_form.submit();

}
// Register end 

// More Pan 
function f_c_applDetailInfo(m1,m2,m3,id) {
	var frm = document.createElement('form');
	frm.method = 'post';
	
	frm.action ="web.categories.RetrieveCategoryApplView.dev";
	
	var mncd1 = document.createElement('input');
	mncd1.id = 'mncd1';
	mncd1.name = 'mncd1';
	mncd1.type = 'hidden';
	mncd1.value = m1;
	frm.appendChild(mncd1);
	
	var mncd2 = document.createElement('input');
	mncd2.id = 'mncd2';
	mncd2.name = 'mncd2';
	mncd2.type = 'hidden';
	mncd2.value = m2;
	frm.appendChild(mncd2);
	
	var mncd3 = document.createElement('input');
	mncd3.id = 'mncd3';
	mncd3.name = 'mncd3';
	mncd3.type = 'hidden';
	mncd3.value =  m3;
	frm.appendChild(mncd3);

	var applId = document.createElement('input');
	applId.id = 'applId';
	applId.name = 'applId';
	applId.type = 'hidden';
	applId.value = id;
	frm.appendChild(applId);

	document.body.appendChild(frm);

	frm.submit();
}

// delete phone not login before 
function f_delPhoneNotLogin(){

	var myAjax = new Ajax.Request(
		'web.member.DeletePhoneNotLoginAjax.dev',
		{
			method : 'POST',
			parameters : {},
			onComplete : function(request) {
				var obj = f_c_getJSONObj(request.responseXML);
				var result = obj.body.result;

				if( result == "Y" ){
					document.menuForm.submit();
				}else{
					var str = '';
					str += 'f_delPhoneNotLogin()' + '\n';
					str += 'Failuer' + '\n';
					alert(str);
				}

			},
			onFailure : function() {
				var str = '';
				str += 'f_delPhoneNotLogin()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);

}

// login after , phone change time. 
function f_userPhoenChange(){
	var modelCode = document.getElementById("_userMocdelCode").value;
	f_userPhoenChangeAjax(modelCode);
}


function f_userPhoenChangeAjax(modelCode,newPlatformCode){
	var myAjax = new Ajax.Request(
		'web.member.UserPhoneChangeAjax.dev',
		{
			method : 'POST',
			parameters : {"modelCode" : modelCode,"newPlatformCode": newPlatformCode
			},
			onComplete : function(request) {
				var obj = f_c_getJSONObj(request.responseXML);
				var result = new Number(obj.body.result).valueOf();	
				
				switch(result){	// 0: open android platform popup, 1 :success , 2:no session, 3: common error
	
					case 0 :	f_c_setAndroidPlatfomCombo('platformCode_phoneSelectAndrPlatform_layer',modelCode);
								showGT540Msg('gt540Msg_phoneSelectAndrPlatform_layer',modelCode);
								document.getElementById('okBtn_phoneSelectAndrPlatform_layer').disabled = false;
								neoDim("phoneSelectAndrPlatform_layer");
								break;
					
					case 1 :	document.menuForm.submit();
								break;
					
					case 2 :	f_c_signInDiv_open();
								break;
					
					case 3 :	document.getElementById('okBtn_phoneSelectAndrPlatform_layer').disabled = false;
								var str = '';
								str += 'f_delPhoneNotLogin()' + '\n';
								str += 'Failuer' + '\n';
								alert(str);								 
								break;
								
				}	

			},
			onFailure : function() {
				var str = '';
				str += 'f_delPhoneNotLogin()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);
}

// Add To Wish List Ajax 
function f_c_addToWishAjax(mncd1, applId){
	var myAjax = new Ajax.Request(
		'web.common.CreateWingWishAjax.dev',
		{
			method : 'POST',
			parameters : {"mncd1" : mncd1,
						  "applId" : applId
			},
			onComplete : function(request) {
				var obj = f_c_getJSONObj(request.responseXML);
				var result = obj.body.result;

				if( result == "Y" ){
					f_c_createWingWishList();
					
					/** Double Point Event Start **/
					document.n_messageDivPop.layerOptionFlag.value = document.hiddenForm.layerOptionFlag.value;
					/** Double Point Event End **/
					
					var wishListPage = "web.member.RetrieveWishList.dev";

					f_c_messageDiv_open(null,g_gotowishlist,wishListPage, null);

				}else if( result == "T" ){
					// Redundancy Check
					f_c_messageDiv_open(g_wishList,g_dupappl, null, null);
				}else if( result == "K" ){
					// compatible phones not.
					f_c_messageDiv_open(g_wishList,g_notsupport, null, null);
				}else{
					var str = '';
					str += 'f_c_addToWishAjax()' + '\n';
					str += 'Failuer' + '\n';
					alert(str);
				}

			},
			onFailure : function() {
				var str = '';
				str += 'f_c_addToWishAjax()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);
}

// Right Wing display 
var wishListCount = 0;
var recentlyListCount = 0;

function f_c_Right_Wing_Display(){

	if( wishListCount > 0 ){
		if( document.getElementById("r_wishList") != null ){
			document.getElementById("r_wishList").style.display = "block";
		}

		if( document.getElementById("r_recentlyView") != null ){
			document.getElementById("r_recentlyView").style.display = "none";
		}
	}

	if( wishListCount == 0 && recentlyListCount > 0 ){
		if( document.getElementById("r_wishList") != null ){
			document.getElementById("r_wishList").style.display = "none";
		}

		if( document.getElementById("r_recentlyView") != null ){
			document.getElementById("r_recentlyView").style.display = "block";
		}
	}

}


// view movie review ajax function 
function goMovieReviewViewAjax(seqId) {
	var myAjax = new Ajax.Request(
		"web.categories.AjaxRetrieveMovieReviewView.dev",
		{
			method : "POST",
			parameters : { "reviewSeqId" : seqId },
			onComplete : function(request) {
						var obj = f_c_getJSONObj(request.responseXML); 
						var result = obj.body.result;
						
						switch(result.charAt(0)){
							case 'Y'	:	//successful view  
								f_showMovieReview(obj);
								break;
						}				
			},
			onFailure : function() {},
			asynchronous : false
		}
	);
}


// show move review 
function f_showMovieReview(obj) {
	var url = obj.body.reviewMovieUrl;
	var showMovieReview = document.getElementById("layer_review_movie");
	
	var dispno = null;
	var typeofBr ='type="application/x-ms-wmp"';

	if (navigator.appName == 'Microsoft Internet Explorer') {
		typeofBr = 'id=mediaplayer standby="loading windows media player components..." classid=clsid:6bf52a52-394a-11d3-b153-00c04f79faa6 viewastext"'+'" style="'+dispno+'"';
	}
	
	var str = '<div id="dim_layer">';
	str += '	<div class="layer_b">';
	str += '		<h1>'+g_review+'</h1>';
	str += '		<div class="layer_con">';
	str += '			<div class="layer_top">';
	str += '				<div class="layer_bottom">';
	str += '					<div class="style_mtb wid_373">';
	str += '						<div class="floatright">';
	str += '							<span class="viewdate">' + obj.body.regDate + '</span>';
	str += '						</div>';
	str += '					</div>';
	str += '					<div class="c_mplayer clear mgb_10">';
	str += '						<object width="380" height="300">';
	str += '							<param name="movie" value="' + url + '"></param>';
	str += '							<param name="allowfullscreen" value="true"></param>';
	str += '							<param name="allowscriptaccess" value="always"></param>';
	str += '							<embed src="' + url + '" type="application/x-shockwave-flash" allowscriptaccess="always" allowfullscreen="true" width="380" height="300"></embed>';
	str += '						</object>';							
	str += '					</div>';
	str += '					<dl class="wid_373 mgb_0" >';
	str += '						<dd>' + obj.body.reviewContent + '</dd>';
	str += '					</dl>';
	str += '				</div>';
	str += '			</div>';
	str += '   		</div>';
	str += '	<div class="btn85">';
	str += '		<span class="button02 mgt_1"><input type="button" value="'+g_close01+'" class="bold" onclick="javascript:f_endMovieReview();" /></span>';
	str += '	</div>';
	str += '  </div>';

	showMovieReview.innerHTML = str;
	
	neoDim("layer_review_movie");
}

// end move flash 
function f_endMovieReview() {
	var showMovieReview = document.getElementById("layer_review_movie");
	showMovieReview.innerHTML = "";
	
	neoClose('layer_review_movie');
}


// Layer Popup 
function f_c_appl_layer_info(idx, mncd1, applId, downloadCnt, reviewCnt, developerName, fileSize, billingTypeCode, wrapClass, listClass){

	lgworld.layer.purchase(idx, mncd1, applId, downloadCnt, reviewCnt, developerName, fileSize, billingTypeCode, wrapClass, listClass);

}

// Sign Close button click,. 
function f_c_sign_close(idx){

	document.hiddenForm.appl_section.value = "";

	neoClose(idx);

}

//Support Page
function f_goGuidePage(objPage){
		if(objPage=="membership"){
			document.menuForm.pageGubun.value = "membership";
		} else if(objPage=="todaysApp"){
			document.menuForm.pageGubun.value = "todaysApp";
		} else if(objPage=="share"){
			document.menuForm.pageGubun.value = "share";
		} else if(objPage=="rss"){
			document.menuForm.mncd1.value 		= "ASF_05_00";
			document.menuForm.mncd2.value 		= "C04";
			document.menuForm.pageGubun.value 	= "rss";
		}
		
		document.menuForm.action = "web.support.RetrieveGuide.dev";
    	document.menuForm.submit();

}
	
function f_goTutorialPage(tab){
	if(tab=="1"){
		document.menuForm.pageGubun.value = "1";
	}
	if(tab=="7"){
		document.menuForm.pageGubun.value = "7";
	}
	
	document.menuForm.action = "web.support.RetrievePhoneModelTutorial.dev";
   	document.menuForm.submit();

}

function f_goUrl(url,mncd1,mncd2,mncd3){
	document.menuForm.mncd1.value = mncd1;
	document.menuForm.mncd2.value = mncd2;
	document.menuForm.mncd3.value = mncd3;
	document.menuForm.action = url;
   	document.menuForm.submit();
}	
	
function f_goUrlPopup(url,gubun){
		
		if(url == '')return;
		
		if(gubun == 'A'){
			window.open(url,'','location=yes,resizable=yes,status=yes,scrollbars=yes');
		}else{
			
			window.open(url,'banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			
			/*
			if('<%=countryCode%>'=="TH"){ 
				window.open('http://<%=countryCode%>.lgmobile.com/web/web.support.manualSoftwareRF.laf','banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			}else if('<%=countryCode%>'=="NG"){
				window.open('http://au.lgmobile.com/web/web.support.retrieveSoftwareUpdate.laf','banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			}else if('<%=countryCode%>'=="MA"){
				window.open('http://fr.lgmobile.com/web/web.support.retrieveSoftwareUpdate.laf','banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			}else if('<%=countryCode%>'=="TR"){
				window.open('http://tr.lgmobile.com/web/web.support.manualSoftwareRF.laf','banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			}else if('<%=countryCode%>'=="UZ"){
				window.open('http://ru.lgmobile.com/web/web.support.retrieveSoftwareUpdate.laf','banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');				
			}else if('<%=countryCode%>'=="IL"){
			 	window.open('http://www.lg.com/il/support/product/support-product.jsp','banner','height=713,width=1000,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			}else{
				window.open('http://<%=countryCode%>.lgmobile.com/web/web.support.retrieveSoftwareUpdate.laf','banner','height=713,width=800,menubar=no,toolbar=no,location=no,resizable=no,status=no,scrollbars=yes,top=100,left=100');
			}
			*/
		}		
}	


/** Double Point Event Start **/
	function f_e_optionAddInfo(layerDivId){
	
		neoClose(layerDivId);
		neoDim("AddInformationDiv");
		
		var myAjax = new Ajax.Request(
				"web.member.RetrieveDoublePointEvent.dev",
				{
					method : 'POST',
					parameters : {},
					onComplete : function(request){
									var obj = f_c_getJSONObj(request.responseXML);
									 
									var genderCode 	=  obj.body.genderCode; 
									var birthStr  	=  obj.body.birthStr; 
									var purchaseday	=  obj.body.purchaseday;
									var yyyy  		=  obj.body.yyyy;
									var dateFormat  =  obj.body.dateFormat; 
									
									document.getElementById("eDateFormat").value = dateFormat;
									
									var birthYear	=	"";
									var birthMonth	=	"";
									var birthDay	=	"";
									
									if(birthStr.length == 8){
										birthYear	=	birthStr.substring(0, 4);
										birthMonth	=	birthStr.substring(4, 6);
										birthDay	=	birthStr.substring(6, 8);
									}
									
									var purchaseYear	=	"";
									var purchaseMonth	=	"";
									var purchaseDay		=	"";
									
									if(purchaseday.length == 8){
										purchaseYear	=	purchaseday.substring(0,4);
										purchaseMonth	=	purchaseday.substring(4,6);
										purchaseDay		=	purchaseday.substring(6,8);
									}
									
									if(genderCode == "M"){
										document.getElementById("eMgender").checked = true;
									}else if(genderCode == "F"){
										document.getElementById("eFgender").checked = true;
									}
									
									var selectIdx = "";
									if(dateFormat == "YYYYMMDD"){
										document.getElementById("dd_birth1").style.display = "block";
										document.getElementById("dd_purchase1").style.display = "block";
										selectIdx = "1";
									}else if(dateFormat == "DDMMYYYY"){
										document.getElementById("dd_birth2").style.display = "block";
										document.getElementById("dd_purchase2").style.display = "block";
										selectIdx = "2";
									}else{
										document.getElementById("dd_birth3").style.display = "block";
										document.getElementById("dd_purchase3").style.display = "block";
										selectIdx = "3";
									}
									
									var yBObj = document.getElementById("eBirthY"+selectIdx);
									var mBObj = document.getElementById("eBirthM"+selectIdx);
									var dBObj = document.getElementById("eBirthD"+selectIdx);
									
									var yPObj = document.getElementById("ePurchaseY"+selectIdx);
									var mPObj = document.getElementById("ePurchaseM"+selectIdx);
									var dPObj = document.getElementById("ePurchaseD"+selectIdx);
									
									/**	monthCombo setting Start	**/
									var mBObjIdx = 0;
									var mPObjIdx = 0;
									if(obj.body.monthList.length > 0){
										var mBObjLen = mBObj.options.length;
										var mPObjLen = mPObj.options.length;
										
										for(var i=0; i<obj.body.monthList.length; i++) {
											if(birthMonth == obj.body.monthList[i].code){
												mBObjIdx = mBObjLen + i ;
											}
											
											if(purchaseMonth == obj.body.monthList[i].code){
												mPObjIdx = mPObjLen + i ;
											}
											mBObj.options.add(new Option(obj.body.monthList[i].value, obj.body.monthList[i].code ));
											mPObj.options.add(new Option(obj.body.monthList[i].value, obj.body.monthList[i].code ));
										}
									}
									mBObj.options[mBObjIdx].selected = true;
									mPObj.options[mPObjIdx].selected = true;
									/**	monthCombo setting End	**/
									
									/**	dayCombo setting Start	**/
									var dBObjIdx = 0;
									var dPObjIdx = 0;
									for(var i=1; i < 32; i++){
										
										var idx = "";
										if(i < 10){ idx = "0"+i; 
										}else{ idx = i; }
										
										if(birthDay == idx){
											dBObjIdx = i ;
										}
										
										if(purchaseDay == idx){
											dPObjIdx = i ;
										}
										dBObj.options.add(new Option(idx, idx));
										dPObj.options.add(new Option(idx, idx));	
									}
									dBObj.options[dBObjIdx].selected = true;
									dPObj.options[dPObjIdx].selected = true;
									/**	dayCombo setting End	**/
									
									/**	yearCombo setting Start	**/
									var yBObjIdx = 0;
									var yBObChk = 1;
									for(var i=yyyy; i >= 1920; i--){
										if(birthYear == i){
											yBObjIdx = yBObChk ;
										}
										yBObj.options.add(new Option(i, i));
										yBObChk++;
									}
									yBObj.options[yBObjIdx].selected = true;
									
									var yPObjIdx = 0;
									var yPObjChk = 1;
									for(var i=yyyy; i >= 2000; i--){
										if(purchaseYear == i){
											yPObjIdx = yPObjChk ;
										}
										yPObj.options.add(new Option(i, i));
										yPObjChk++;
									}
									yPObj.options[yPObjIdx].selected = true;
									/**	yearCombo setting End	**/
									
					},
					onFailure : function(){
									neoClose("AddInformationDiv");
									f_c_messageDiv_open(null,'ajax failur', null, null);
					},
					asynchronous : false
				}
			);
		
	
	}
	
	function f_e_addInfoSave(){
	
		var dateFormat = document.getElementById("eDateFormat").value.trim();
		var nameIdx = "";
		if(dateFormat == "YYYYMMDD"){
			nameIdx = "1";
		}else if(dateFormat == "DDMMYYYY"){
			nameIdx = "2";
		}else{
			nameIdx = "3";
		}
		var birthY = document.getElementById("eBirthY"+nameIdx).value;
		var birthM = document.getElementById("eBirthM"+nameIdx).value;
		var birthD = document.getElementById("eBirthD"+nameIdx).value;
		
		var purchaseY = document.getElementById("ePurchaseY"+nameIdx).value;
		var purchaseM = document.getElementById("ePurchaseM"+nameIdx).value;
		var purchaseD = document.getElementById("ePurchaseD"+nameIdx).value;
		
		//var gender = document.addInfoForm.gender.value;
		
		var chkGender = document.getElementsByName('eGender');
		var genderCode = "";
		
		for(var i=0; i<chkGender.length; i++) {
			if(chkGender[i].checked) {
				genderCode = chkGender[i].value;
			}
		}
		if(genderCode == "") {
			document.getElementById("eMgender").focus();
			document.getElementById("eErrorGenderMsg").style.display = "block";
			return false;
		}else{
			document.getElementById("eErrorGenderMsg").style.display = "none";
		}
		
		if( birthY == "" || birthM == "" || birthD == "" ){
			if(birthY == ""){
				document.getElementById("eBirthY"+nameIdx).focus();
			}else if(birthM == ""){
				document.getElementById("eBirthM"+nameIdx).focus();
			}else{
				document.getElementById("eBirthD"+nameIdx).focus();
			}
			
			document.getElementById("eErrorBirthMsg"+nameIdx).style.display = "block";
			return;
		}else{
			document.getElementById("eErrorBirthMsg"+nameIdx).style.display = "none";
		}
		
		if( purchaseY == "" || purchaseM == "" || purchaseD == "" ){
			if(purchaseY == ""){
				document.getElementById("ePurchaseY"+nameIdx).focus();
			}else if(purchaseM == ""){
				document.getElementById("ePurchaseM"+nameIdx).focus();
			}else{
				document.getElementById("ePurchaseD"+nameIdx).focus();
			}
			
			document.getElementById("eErrorPurchaseMsg"+nameIdx).style.display = "block";
			return;
		}else{
			document.getElementById("eErrorPurchaseMsg"+nameIdx).style.display = "none";
		}
		
		var birthYyyymmdd	=	birthY + birthM + birthD;
		var purchaseDate	=	purchaseY + purchaseM + purchaseD;
		
		var myAjax = new Ajax.Request(
				"web.member.UpdateDoublePointEvent.dev",
				{
					method : 'POST',
					parameters : {"genderCode"			:	genderCode
									,"birthYyyymmdd"	:	birthYyyymmdd
									,"purchaseDate"		:	purchaseDate
									,"errIdIndex"		:	nameIdx
								},
					onComplete : function(request){
									var obj = f_c_getJSONObj(request.responseXML);
									
									var errCode = obj.body.errCode;
									var errMsgId = obj.body.errMsgId;
									var errIdIndex = obj.body.errIdIndex;
									
									if(errCode == "N"){
										document.getElementById(errmsgId).style.display = "block";
									}else{
										neoClose("AddInformationDiv");
										neoDim("AddInfoConfirmationDiv");
									}
					},
					onFailure : function(){
									neoClose("AddInformationDiv");
									f_c_messageDiv_open(null,'ajax failur', null, null);
					},
					asynchronous : false
				}
			);
	}
	
	function f_e_sendActivity(){
		neoClose('AddInfoConfirmationDiv');
		
		document.addInfoComplete.action = "web.member.RetrieveActivityList.dev";
		document.addInfoComplete.submit();
	}
	/** Double Point Event End **/

//Support Page 
function f_goAndroidDownload(){
	neoClose('dim_android');
	
    var loginCheckAjax = new getIsLoggedInAjax();
    if( loginCheckAjax.isLoggedIn == "true" ){
        f_c_apkClientVerDownload();
    }else{
        f_c_signInDiv_open();
    }
}



// Right Wing Recently List 
function f_c_createWingRecentlyList(){
	var myAjax = new Ajax.Request(
		'web.common.RetrieveWingRecentlyListAjax.dev',
		{
			method : 'POST',
			parameters : {},
			onComplete : f_c_retrieveRecentlyList,
			onFailure : function() {
				var str = '';
				str += 'f_c_createWingList()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);
}

function f_c_retrieveRecentlyList(request){
	var recently = f_c_getJSONObj(request.responseXML);

	if( f_c_isData(recently) ){

		var recentList = document.getElementById("recentList");

		if( f_c_isData(document.getElementById("recentDl")) ){
			recentList.removeChild(document.getElementById("recentDl"));
		}

		var recentlyLength = recently.body.recentlyList.length;
		recentlyListCount = recently.body.recentlyList.length;

		var recentDL = null;

		// Recently View start
		recentDL = new createObject("recentDl","dl");
		var recentDT = new createObject("","dt");
		var recentDD = new createObject("r_recentlyView","dd");

		var titWingbox = new createObject("","span");
		titWingbox.setClass("tit_wingbox");

		var numbox = new createObject("","span");
		numbox.setClass("numbox");

		numbox.setValue("(<span class=\"num\">" + recentlyLength + "</span>)");

		var titWingboxAhref = new createObject("","a");
		titWingboxAhref.setHref("#none");
		titWingboxAhref.setOnClick(function() { viewRecently() });

		if( recentlyLength == 0 ){
			//titWingboxAhref.setValue("<LTag:message code="re.common.label.recentelyviewed"/>");
			//titWingbox.obj.appendChild(titWingboxAhref.obj);
			titWingbox.setValue(g_recentelyviewed);
			recentDD.setClass("no_recently");
			recentDD.setValue(g_norecentelyviewed);
		}else{

			titWingboxAhref.setValue(g_recentelyviewed);
			titWingbox.obj.appendChild(titWingboxAhref.obj);

			recentDD.setClass("recent_list");

			var recentlySum = new createObject("recently_sum","div");
			recentlySum.setClass("wing_txt_list");

			var recentWingdiv = new createObject("recent_wingdiv","div");
			recentWingdiv.setClass("layer_wingdiv");

			var recentWing = new createObject("recent_wing","ul");
			recentWing.setClass("layer_wing");
			recentWing.obj.style.position = "absolute";
			recentWing.obj.style.left = "0";
			recentWing.obj.style.top = "0";

			var topPX = 25;
			var CounLan = g_countryCode+g_languageCode;

			for(var i=0; i<recentlyLength; i++){

				var applId = recently.body.recentlyList[i].applId;
				var displayName = recently.body.recentlyList[i].displayName;
				var applNameShort = recently.body.recentlyList[i].applNameShort;
				var thumbnailImg = recently.body.recentlyList[i].thumbnailImg;
				var categoryCode = recently.body.recentlyList[i].categoryCode;
				var categoryName = recently.body.recentlyList[i].categoryName;
				var genreCode = recently.body.recentlyList[i].genreCode;
				var avgReviewScore = recently.body.recentlyList[i].avgReviewScore;
				var contentGrade = recently.body.recentlyList[i].contentGrade;
				var developerName = recently.body.recentlyList[i].developerName;
				var maxStandardPrice = recently.body.recentlyList[i].maxStandardPrice;
				var minStandardPrice = recently.body.recentlyList[i].minStandardPrice;
				var maxSettlePrice = recently.body.recentlyList[i].maxSettlePrice;
				var minSettlePrice = recently.body.recentlyList[i].minSettlePrice;
				var applyStartDate = recently.body.recentlyList[i].applyStartDate;
				var applyEndDate = recently.body.recentlyList[i].applyEndDate;
				var standardCurrencyCode = recently.body.recentlyList[i].standardCurrencyCode;
				var viewPrice = recently.body.recentlyList[i].viewPrice;
				var ageRestrictionCode = recently.body.recentlyList[i].ageRestrictionCode;
				var ageRestrictionName = recently.body.recentlyList[i].ageRestrictionName;
				var billingTypeCode = recently.body.recentlyList[i].billingTypeCode;
				var choiceYn = recently.body.recentlyList[i].choiceYn;		
				var menu1 = recently.body.recentlyList[i].menu1;
				var orderNum = recently.body.recentlyList[i].orderNum;	
				//var preLoadGubun = recently.body.recentlyList[i].preLoadGubun;					

				// layer popup start
				var recentDetail = new createObject("recent_" + parseInt(i, 10),"div");
				recentDetail.setClass("wrap_wing_lay");

				recentDetail.obj.style.position = "absolute";
				if(CounLan == "AEAR" || CounLan == "IRPR" || CounLan == "ILIW" || CounLan == "MAAR"  || CounLan == "SAAR" ){
					recentDetail.obj.style.right = "-150px";
				}else{
					recentDetail.obj.style.left = "-150px";
				}

				if( i == 0 ){
					recentDetail.obj.style.top = "25px";
				}else{
					topPX = topPX + 60
					recentDetail.obj.style.top = topPX + "px";
				}

				recentDetail.obj.style.display = "none";

				var wingLay = new createObject("","div");
				wingLay.setClass("wing_lay");

				var wingLaySpan1 = new createObject("","span");
				wingLaySpan1.setClass("tit");

				var recentApplTitle = new createObject("","a");
				var detailLink = "javascript:f_c_applDetailInfo('" + menu1 + "','" + categoryCode + "','" + genreCode + "','" + applId + "');";

				recentApplTitle.setHref(detailLink);
				recentApplTitle.setValue(applNameShort);

				wingLaySpan1.obj.appendChild(recentApplTitle.obj);

				var wingLaySpan2 = new createObject("","span");
				wingLaySpan2.setClass("kind");
				wingLaySpan2.setValue(developerName);

				var wingLaySpan3 = new createObject("","span");
				wingLaySpan3.setClass("star");
				wingLaySpan3.setValue(f_c_getAvgReviewImg(avgReviewScore));
				
				var wingLaySpan4 = new createObject("","span");
				wingLaySpan4.setClass("price");
				wingLaySpan4.setValue(lgworld.veiwPrice(viewPrice, maxStandardPrice, minSettlePrice, standardCurrencyCode));				

				wingLay.obj.appendChild(wingLaySpan1.obj);
				wingLay.obj.appendChild(wingLaySpan2.obj);
				wingLay.obj.appendChild(wingLaySpan3.obj);
				wingLay.obj.appendChild(wingLaySpan4.obj);

				recentDetail.obj.appendChild(wingLay.obj);

				recentlySum.obj.appendChild(recentDetail.obj);

				// layer popup end

				// recent list end 
				var recentWingLi = new createObject("","li");
				
				var recentWingSpan = new createObject("","span");
				recentWingSpan.setClass("wrap_crop03");

				var recentWingLiA = new createObject("","a");
				recentWingLiA.setClass("crop");
				recentWingLiA.setHref(detailLink);

				recentWingLiA.setOnMouseOver((function(a,b) { return function() { viewWing_over(a,b) } } )('recent_' + parseInt(i, 10), 'over'));
				recentWingLiA.setOnMouseOut((function(a,b) { return function() { viewWing_out(a,b) } } )('recent_' + parseInt(i, 10), 'out'));

				var recentWingLiImg = new createObject("","img");
				recentWingLiImg.obj.onerror = function() { this.src=g_contextPath+'/images/common/noimg_64x64.jpg'; };
				recentWingLiImg.setSrc(g_contextPath + thumbnailImg);
				recentWingLiImg.setStyleWidth("45px");
				recentWingLiImg.setStyleHeight("45px");
				
				var recentWingLiAImg = new createObject("","img");
				recentWingLiAImg.setSrc(g_contextPath+"/images/common/crop_45.png");
				recentWingLiAImg.setStyleWidth("45px");
				recentWingLiAImg.setStyleHeight("45px");
                
                //if("D" == preLoadGubun){
                //   var wishWing3DconImg = new createObject("","img");
	            //    wishWing3DconImg.setSrc(g_contextPath+"/images/repair/badge_45.png");
	            //    wishWing3DconImg.setClass("badge45");
	            //    recentWingLiA.obj.appendChild(wishWing3DconImg.obj);
                //}
                
				recentWingLiA.obj.appendChild(recentWingLiAImg.obj);
				recentWingSpan.obj.appendChild(recentWingLiImg.obj);
				recentWingSpan.obj.appendChild(recentWingLiA.obj);

				var delBox = new createObject("","div");
				delBox.setClass("delbox");

				var subDel = new createObject("","div");
				subDel.setClass("del");

				var subDelA = new createObject("","a");
				var subDelAHref = "javascript:f_c_deleteWingRecently('" + applId + "');";
				subDelA.setHref(subDelAHref);

				var subDelImg = new createObject("","img");
				subDelImg.setSrc(g_contextPath+"/images/common/btn_x.png");

				subDelA.obj.appendChild(subDelImg.obj);
				subDel.obj.appendChild(subDelA.obj);
				delBox.obj.appendChild(subDel.obj);
				recentWingLi.obj.appendChild(recentWingSpan.obj);
				recentWingLi.obj.appendChild(delBox.obj);
				recentWing.obj.appendChild(recentWingLi.obj);

				// recent list end

			}

			recentDD.obj.appendChild(recentlySum.obj);
			recentWingdiv.obj.appendChild(recentWing.obj);

			var recentUp = new createObject("","a");
			var imgNm = "off";
			
			if(recentlyLength > 5){
				imgNm = "on";
			}

			recentUp.obj.className = "up";
			recentUp.setHref("#none");
			recentUp.setOnClick((function(a) { return function() { recent_wingListToggle(a) } } )("next"));

			var recentUpImg = new createObject("","img");
			recentUpImg.setSrc(g_contextPath+"/images/common/btn_up_"+imgNm+".gif");
			recentUpImg.obj.className = "imgover";

			recentUp.obj.appendChild(recentUpImg.obj);

			var recentDown = new createObject("","a");
			recentDown.obj.className = "down";
			recentDown.setHref("#none");
			recentDown.setOnClick((function(a) { return function() { recent_wingListToggle(a) } } )("prev"));

			var recentDownImg = new createObject("","img");
			recentDownImg.setSrc(g_contextPath+"/images/common/btn_down_"+imgNm+".gif");
			recentDownImg.obj.className = "imgover";

			recentDown.obj.appendChild(recentDownImg.obj);

			recentDD.obj.appendChild(recentWingdiv.obj);
			recentDD.obj.appendChild(recentUp.obj);
			recentDD.obj.appendChild(recentDown.obj);
		}

		recentDT.obj.appendChild(titWingbox.obj);
		recentDT.obj.appendChild(numbox.obj);

		recentDL.obj.appendChild(recentDT.obj);
		recentDL.obj.appendChild(recentDD.obj);

		recentList.appendChild(recentDL.obj);

		if( recentlyLength > 0 ){
			f_c_wingListBottomset();
			wingOver();
			imgOver();
		}
		// Recently View

	}
}


// Right Wing Delete 
function f_c_deleteWingRecently(applId){
	var myAjax = new Ajax.Request(
		'web.common.DeleteWingRecentlyAjax.dev',
		{
			method : 'POST',
			parameters : {"applId" : applId
			},
			onComplete : function(request) {
				var obj = f_c_getJSONObj(request.responseXML);
				var result = obj.body.result;

				if( result == "Y" ){
					f_c_createWingRecentlyList();
					document.getElementById("r_wishList").style.display = "none";
					document.getElementById("r_recentlyView").style.display = "block";
				}else{
					var str = '';
					str += 'f_c_deleteWingRecently()' + '\n';
					str += 'Failuer' + '\n';
					alert(str);
				}

			},
			onFailure : function() {
				var str = '';
				str += 'f_c_deleteWingRecently()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);
}


// Right Wing Wish List 
function f_c_createWingWishList(){
	var myAjax = new Ajax.Request(
		'web.common.RetrieveWingWishListAjax.dev',
		{
			method : 'POST',
			parameters : {},
			onComplete : f_c_retrieveWishList,
			onFailure : function() {
				var str = '';
				str += 'f_c_createWingList()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);
}



function f_c_retrieveWishList(request){
	var wish = f_c_getJSONObj(request.responseXML);

	if( f_c_isData(wish) ){

		var recentList = document.getElementById("recentList");

		// 
		if( f_c_isData(document.getElementById("wishDl")) ){
			recentList.removeChild(document.getElementById("wishDl"));
		}

		var wishLength = wish.body.wishList.length;
		wishListCount = wish.body.wishList.length;

		var wishDL = null;

		// Wish
		wishDL = new createObject("wishDl","dl");
		var wishDT = new createObject("","dt");
		var wishDD = new createObject("r_wishList","dd");

		var titWingbox = new createObject("","span");
		titWingbox.setClass("tit_wingbox mgt_10");

		var numbox = new createObject("","span");
		numbox.setClass("numbox");

		numbox.setValue("(<span class=\"num\">" + wishLength + "</span>)");

		if( wishLength == 0 ){
			/*
			var titWingboxAhref = new createObject("","a");
			titWingboxAhref.setHref("#none");
			titWingboxAhref.setOnClick(function() { viewWishList() });
			titWingboxAhref.setValue("<LTag:message code="re.common.btn.wishList"/>");
			titWingbox.obj.appendChild(titWingboxAhref.obj);
			*/

			titWingbox.setValue(g_wishList);

			/*
			wishDD.setClass("no_recently");
			wishDD.setValue("<LTag:message code="re.common.label.notinwhishlist"/>");
			*/
		}else{

			var titWingboxAhref = new createObject("","a");
			titWingboxAhref.setHref("#none");
			titWingboxAhref.setOnClick(function() { viewWishList() });
			titWingboxAhref.setValue(g_wishList);
			titWingbox.obj.appendChild(titWingboxAhref.obj);

			wishDD.setClass("recent_list");

			var wishSum = new createObject("wish_sum","div");
			wishSum.setClass("wing_txt_list");

			var wishWingdiv = new createObject("wish_wingdiv","div");
			wishWingdiv.setClass("layer_wingdiv");

			var wishWing = new createObject("wish_wing","ul");
			wishWing.setClass("layer_wing");
			wishWing.obj.style.position = "absolute";
			wishWing.obj.style.left = "0";
			wishWing.obj.style.top = "0";

			var topPX = 25;
			var CounLan = g_countryCode+g_languageCode;

			for(var i=0; i<wishLength; i++){

				var applId = wish.body.wishList[i].applId;
				var displayName = wish.body.wishList[i].displayName;
				var applNameShort = wish.body.wishList[i].applNameShort;
				var thumbnailImg = wish.body.wishList[i].thumbnailImg;
				var categoryCode = wish.body.wishList[i].categoryCode;
				var categoryName = wish.body.wishList[i].categoryName;
				var genreCode = wish.body.wishList[i].genreCode;
				var avgReviewScore = wish.body.wishList[i].avgReviewScore;
				var menuCode1 = wish.body.wishList[i].menuCode1;
				var rnum = wish.body.wishList[i].rnum;
				var applOrderNum = wish.body.wishList[i].applOrderNum;
				var creationDate = wish.body.wishList[i].creationDate;
				var contentGrade = wish.body.wishList[i].contentGrade;
				var developerName = wish.body.wishList[i].developerName;
				var maxStandardPrice = wish.body.wishList[i].maxStandardPrice;
				var minStandardPrice = wish.body.wishList[i].minStandardPrice;
				var maxSettlePrice = wish.body.wishList[i].maxSettlePrice;
				var minSettlePrice = wish.body.wishList[i].minSettlePrice;
				var applyStartDate = wish.body.wishList[i].applyStartDate;
				var applyEndDate = wish.body.wishList[i].applyEndDate;
				var standardCurrencyCode = wish.body.wishList[i].standardCurrencyCode;
				var viewPrice = wish.body.wishList[i].viewPrice;
				var ageRestrictionCode = wish.body.wishList[i].ageRestrictionCode;
				var ageRestrictionName = wish.body.wishList[i].ageRestrictionName;
				var billingTypeCode = wish.body.wishList[i].billingTypeCode;
				var choiceYn = wish.body.wishList[i].choiceYn;
				//var preLoadGubun = wish.body.wishList[i].preLoadGubun;

				// layer popup start
				var wishDetail = new createObject("wish_" + parseInt(i, 10),"div");
				wishDetail.setClass("wrap_wing_lay");

				wishDetail.obj.style.position = "absolute";
				if(CounLan == "AEAR" || CounLan == "IRPR" || CounLan == "ILIW" || CounLan == "MAAR" || CounLan == "SAAR" ){
					wishDetail.obj.style.right = "-150px";
				}else{
					wishDetail.obj.style.left = "-150px";
				}
				if( i == 0 ){
					wishDetail.obj.style.top = "25px";
				}else{
					topPX = topPX + 60
					wishDetail.obj.style.top = topPX + "px";
				}

				wishDetail.obj.style.display = "none";

				var wingLay = new createObject("","div");
				wingLay.setClass("wing_lay");

				var wingLaySpan1 = new createObject("","span");
				wingLaySpan1.setClass("tit");

				var wishApplTitle = new createObject("","a");
				var detailLink = "javascript:f_c_applDetailInfo('" + menuCode1 + "','" + categoryCode + "','" + genreCode + "','" + applId + "');";

				wishApplTitle.setHref(detailLink);
				wishApplTitle.setValue(applNameShort);

				wingLaySpan1.obj.appendChild(wishApplTitle.obj);

				var wingLaySpan2 = new createObject("","span");
				wingLaySpan2.setClass("kind");
				wingLaySpan2.setValue(developerName);

				var wingLaySpan3 = new createObject("","span");
				wingLaySpan3.setClass("star");
				wingLaySpan3.setValue(f_c_getAvgReviewImg(avgReviewScore));
		
				var wingLaySpan4 = new createObject("","span");
				wingLaySpan4.setClass("price");
				wingLaySpan4.setValue(lgworld.veiwPrice(viewPrice, maxStandardPrice, minSettlePrice, standardCurrencyCode));
				
				wingLay.obj.appendChild(wingLaySpan1.obj);
				wingLay.obj.appendChild(wingLaySpan2.obj);
				wingLay.obj.appendChild(wingLaySpan3.obj);
				wingLay.obj.appendChild(wingLaySpan4.obj);

				wishDetail.obj.appendChild(wingLay.obj);

				wishSum.obj.appendChild(wishDetail.obj);

				// layer popup end

				// Wish list start
				var wishWingLi = new createObject("","li");

				var wishWingSpan = new createObject("","span");
				wishWingSpan.setClass("wrap_crop03");

				var wishWingLiA = new createObject("","a");
				wishWingLiA.setClass("crop");
				wishWingLiA.setHref(detailLink);

				wishWingLiA.setOnMouseOver((function(a,b) { return function() { viewWing_over02(a,b) } } )('wish_' + parseInt(i, 10), 'over'));
				wishWingLiA.setOnMouseOut((function(a,b) { return function() { viewWing_out02(a,b) } } )('wish_' + parseInt(i, 10), 'out'));

				var wishWingLiImg = new createObject("","img");
				wishWingLiImg.obj.onerror = function() { this.src=g_contextPath+'/images/common/noimg_64x64.jpg'; };
				wishWingLiImg.setSrc(g_contextPath + thumbnailImg);
				wishWingLiImg.setClass("imgs_45");
				//wishWingLiImg.setStyleWidth("45px");
				//wishWingLiImg.setStyleHeight("45px");

				var wishWingLiAImg = new createObject("","img");
				wishWingLiAImg.setSrc(g_contextPath+"/images/common/crop_45.png");
				//wishWingLiAImg.setStyleWidth("45px");
				//wishWingLiAImg.setStyleHeight("45px");
				
				//if("D" == preLoadGubun){
				//	var wishWing3DconImg = new createObject("","img");
	            //    wishWing3DconImg.setSrc(g_contextPath+"/images/repair/badge_45.png");
	            //    wishWing3DconImg.setClass("badge45");
				//	wishWingLiA.obj.appendChild(wishWing3DconImg.obj);
                //}
                
				wishWingLiA.obj.appendChild(wishWingLiAImg.obj);
				wishWingSpan.obj.appendChild(wishWingLiImg.obj);
				wishWingSpan.obj.appendChild(wishWingLiA.obj);

				var delBox = new createObject("","div");
				delBox.setClass("delbox");

				var subDel = new createObject("","div");
				subDel.setClass("del");

				var subDelA = new createObject("","a");
				var subDelAHref = "javascript:f_c_deleteWingWish('" + applId + "','" + applOrderNum + "');";
				subDelA.setHref(subDelAHref);

				var subDelImg = new createObject("","img");
				subDelImg.setSrc(g_contextPath+"/images/common/btn_x.png");

				subDelA.obj.appendChild(subDelImg.obj);
				subDel.obj.appendChild(subDelA.obj);
				delBox.obj.appendChild(subDel.obj);
				wishWingLi.obj.appendChild(wishWingSpan.obj);
				wishWingLi.obj.appendChild(delBox.obj);
				wishWing.obj.appendChild(wishWingLi.obj);

				// Wish list end

			}

			wishDD.obj.appendChild(wishSum.obj);
			wishWingdiv.obj.appendChild(wishWing.obj);

			var wishUp = new createObject("","a");
			var imgNm = "off";
			
			if(wishLength > 5){
				imgNm = "on";
			}

			wishUp.obj.className = "up";
			wishUp.setHref("#none");
			wishUp.setOnClick((function(a) { return function() { wish_wingListToggle(a) } } )("next"));

			var wishUpImg = new createObject("","img");
			wishUpImg.setSrc(g_contextPath+"/images/common/btn_up_"+imgNm+".gif");
			wishUpImg.obj.className = "imgover";

			wishUp.obj.appendChild(wishUpImg.obj);

			var wishDown = new createObject("","a");
			wishDown.obj.className = "down";
			wishDown.setHref("#none");
			wishDown.setOnClick((function(a) { return function() { wish_wingListToggle(a) } } )("prev"));

			var wishDownImg = new createObject("","img");
			wishDownImg.setSrc(g_contextPath+"/images/common/btn_down_"+imgNm+".gif");
			wishDownImg.obj.className = "imgover";

			wishDown.obj.appendChild(wishDownImg.obj);

			wishDD.obj.appendChild(wishWingdiv.obj);
			wishDD.obj.appendChild(wishUp.obj);
			wishDD.obj.appendChild(wishDown.obj);
		}

		wishDT.obj.appendChild(titWingbox.obj);
		wishDT.obj.appendChild(numbox.obj);

		wishDL.obj.appendChild(wishDT.obj);
		wishDL.obj.appendChild(wishDD.obj);

		recentList.appendChild(wishDL.obj);

		if( wishLength > 0 ){
			f_c_wingListBottomset02();
			wingOver02();
			imgOver();
		}
		// Wishly View

		// RecentlyList call(not call is chage position) 
		f_c_createWingRecentlyList();

	}
}



// Right Wing Delete 
function f_c_deleteWingWish(applId, applOrderNum){
	var myAjax = new Ajax.Request(
		'web.common.DeleteWingWishAjax.dev',
		{
			method : 'POST',
			parameters : {"applId" : applId,
						  "applOrderNum" : applOrderNum
			},
			onComplete : function(request) {
				var obj = f_c_getJSONObj(request.responseXML);
				var result = obj.body.result;

				if( result == "Y" ){
					f_c_createWingWishList();
					document.getElementById("r_wishList").style.display = "block";
					document.getElementById("r_recentlyView").style.display = "none";
				}else{
					var str = '';
					str += 'f_c_deleteWingWish()' + '\n';
					str += 'Failuer' + '\n';
					alert(str);
				}

			},
			onFailure : function() {
				var str = '';
				str += 'f_c_deleteWingWish()' + '\n';
				str += 'Failuer' + '\n';
				alert(str);
			},
			asynchronous : false
		}
	);
}


// Layer message. 
function f_c_messageDivTitle_open(title, msg, okUrl, closeUrl){

	var vCloseUrl = "";

	document.getElementById("messageDivTitleMsgTitle").innerHTML = "";
	document.getElementById("messageDivTitleMsgContent").innerHTML = "";
	document.getElementById("messageDivTitleMsgBottom").innerHTML = "";

	if( title != null ){
		document.getElementById("messageDivTitleMsgTitle").innerHTML = title;
	}

	if( msg != null ){
		document.getElementById("messageDivTitleMsgContent").innerHTML = msg;
	}

	if( closeUrl != null && closeUrl != "" ){
		vCloseUrl = "javascript:f_c_message_Submit('" + closeUrl + "');";
	}else{
		vCloseUrl = "neoClose('messageDivTitle_open');";
	}

	if( okUrl != null && okUrl != "" ){
		if(okUrl.indexOf('javascript:') === 0) {
			document.getElementById("messageDivTitleMsgBottom").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_ok+"\" class=\"bold\" onClick=\"" + okUrl + "\"/></span><span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
		} else {
			document.getElementById("messageDivTitleMsgBottom").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_ok+"\" class=\"bold\" onClick=\"javascript:f_c_message_Submit('" + okUrl + "');\"/></span><span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
		}
	}else{
		document.getElementById("messageDivTitleMsgBottom").innerHTML = "<span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
	}

	neoDim("messageDivTitle_open");

}

function f_c_messageDivTitleNew_open(title, msg,okUrl, closeUrl){

    var vCloseUrl = "";    
  
    if( title != null ){
        document.getElementById("layer_message1").innerHTML = title;
    }

    if( msg != null ){
        document.getElementById("layer_message2").innerHTML = msg;
    }
    
    document.getElementById("layer_message3").innerHTML = g_howtobuypopup3;
    document.getElementById("layer_message4").innerHTML = g_howtobuypopup4;
    document.getElementById("layer_message5").innerHTML = g_howtobuypopup5;
    document.getElementById("layer_message6").innerHTML = g_howtobuypopup6;
    document.getElementById("layer_message8").innerHTML = g_howtobuycommon1;
    document.getElementById("layer_message9").innerHTML = g_howtobuycommon2;
    document.getElementById("layer_message12").innerHTML = g_howtobuycommon5;
    document.getElementById("layer_message13").innerHTML = g_howtobuycommon6;
    
    
    if( closeUrl != null && closeUrl != "" ){
        vCloseUrl = "javascript:f_c_message_Submit('" + closeUrl + "');";
    }else{
        vCloseUrl = "neoClose('messageDivTitle_open');";
    }
    if( okUrl != null && okUrl != "" ){
        if(okUrl.indexOf('javascript:') === 0) {
            document.getElementById("layer_message7").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_addtowish+"\" class=\"bold\" onClick=\"" + okUrl + "\"/></span><span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";    
        } else {
            document.getElementById("layer_message7").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_ok+"\" class=\"bold\" onClick=\"javascript:f_c_message_Submit('" + okUrl + "');\"/></span><span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
        }
    }else{
        document.getElementById("layer_message7").innerHTML = "<span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
    }   
    neoDim("layer_message");

}

// Layer message. 
function f_c_messageDiv_open(title, msg, okUrl, closeUrl){
	var vCloseUrl = "";
	
	/** Double Point Event Start **/
	var optionDiv = "";
	var isLogin = g_isLoggedIn;
    var layerOptionFlag = document.hiddenForm.layerOptionFlag.value;
     
    if(isLogin){
    	if(layerOptionFlag == "N"){
			var optionUserGrade = g_optionUserGrade;
			if(optionUserGrade == "03"){
				optionDiv = "neoDim('optionSingleDiv');";
			}else{
				optionDiv = "neoDim('optionNoSingleDiv');";
			}
    	}
    	
    	document.hiddenForm.layerOptionFlag.value = "";
    }
    /** Double Point Event Start **/
        
	document.getElementById("messageDivMsgTitle").innerHTML = "";
	document.getElementById("messageDivMsgContent").innerHTML = "";
	document.getElementById("messageDivMsgBottom").innerHTML = "";

	if( title != null ){
		document.getElementById("messageDivMsgTitle").innerHTML = "<h5 class=\"wish_tits text_size\">" + title + "</h5>";
		document.getElementById("messageDivMsgTitle").style.display = "block";
	}

	if( msg != null ){
		document.getElementById("messageDivMsgContent").innerHTML = msg;
	}

	if( closeUrl != null && closeUrl != "" ){
		vCloseUrl = "javascript:f_c_message_Submit('" + closeUrl + "');";
	}else{
		//vCloseUrl = "neoClose('messageDiv_open');";		// Double Point Event end time
		vCloseUrl = "neoClose('messageDiv_open');" + optionDiv;		// Double Point Event end time of delete  
	}

	if( okUrl != null && okUrl != "" ){
		if(okUrl.indexOf('javascript:') === 0) {
			document.getElementById("messageDivMsgBottom").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_ok+"\" class=\"bold\" onClick=\"" + okUrl + "\"/></span>  <span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
		} else {
			document.getElementById("messageDivMsgBottom").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_ok+"\" class=\"bold\" onClick=\"javascript:f_c_message_Submit('" + okUrl + "');\"/></span>  <span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
		}
	}else{
		document.getElementById("messageDivMsgBottom").innerHTML = "<span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
	}
	
	if( sonar.ui.modalMaker.IS_OPEN ){neoClose(close);}
		
	neoDim("messageDiv_open");

}


// Layer Popup message. 
function f_c_messageDivNew_open(title, msg, okUrl, closeUrl){
    var vCloseUrl = "";
    
    /** Double Point Event Start **/
    var optionDiv = "";
    var isLogin = g_isLoggedIn;
    var layerOptionFlag = document.hiddenForm.layerOptionFlag.value;
     
    if(isLogin){
        if(layerOptionFlag == "N"){
            var optionUserGrade = g_optionUserGrade;
            if(optionUserGrade == "03"){
                optionDiv = "neoDim('optionSingleDiv');";
            }else{
                optionDiv = "neoDim('optionNoSingleDiv');";
            }
        }
        
        document.hiddenForm.layerOptionFlag.value = "";
    }
    /** Double Point Event Start **/
   
    document.getElementById("layer_message_p_2_add").innerHTML = g_youcanfind;
    document.getElementById("layer_message_p_8").innerHTML = g_howtobuycommon1;
    document.getElementById("layer_message_p_9").innerHTML = g_howtobuycommon2;
    document.getElementById("layer_message_p_12").innerHTML = g_howtobuycommon5;
    document.getElementById("layer_message_p_13").innerHTML = g_howtobuycommon6;
    if( title != null ){
       document.getElementById("layer_message_p_1").style.display = "none";
    }

    if( msg != null ){
       document.getElementById("layer_message_p_2").innerHTML = msg;
    }

    if( closeUrl != null && closeUrl != "" ){
        vCloseUrl = "javascript:f_c_message_Submit('" + closeUrl + "');";
    }else{
        vCloseUrl = "neoClose('messageDivTitle_open');";
    }
    
    if( okUrl != null && okUrl != "" ){
        if(okUrl.indexOf('javascript:') === 0) {
            document.getElementById("layer_message_p_7").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_addtowish+"\" class=\"bold\" onClick=\"" + okUrl + "\"/></span><span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
        } else {
            document.getElementById("layer_message_p_7").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_addtowish+"\" class=\"bold\" onClick=\"javascript:f_c_message_Submit('" + okUrl + "');\"/></span><span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
        }
    }else{
        document.getElementById("layer_message_p_7").innerHTML = "<span class=\"button02\"><input type=\"button\" value=\""+g_close01+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
    }   
  
    
    if( sonar.ui.modalMaker.IS_OPEN ){neoClose(close);}
        
    neoDim("layer_message_p");

}



// Layer message. 
function f_c_message_Submit(url){
	document.n_messageDivPop.action = url;
	document.n_messageDivPop.submit();
}

// Layer message Redirect Url 
function f_c_messageRedirect_open(title, msg, okUrl, closeUrl, returnUrl){
	var vCloseUrl = "";
	document.getElementById("messageDivTitleMsgTitle").innerHTML = "";
	document.getElementById("messageDivTitleMsgContent").innerHTML = "";
	document.getElementById("messageDivTitleMsgBottom").innerHTML = "";
	if( title != null ){
		document.getElementById("messageDivTitleMsgTitle").innerHTML = title;
	}
	if( msg != null ){
		document.getElementById("messageDivTitleMsgContent").innerHTML = msg;
	}

	if( closeUrl != null && closeUrl != "" ){
		vCloseUrl = "javascript:f_c_message_Submit('" + closeUrl + "');";
	}else{
		vCloseUrl = "neoClose('messageDivTitle_open');";
	}
	if( okUrl != null && okUrl != "" ){
		document.getElementById("messageDivTitleMsgBottom").innerHTML = "<span class=\"button02_confirm size4 \"><input type=\"button\" value=\""+g_ok+"\" class=\"bold\" onClick=\"javascript:f_c_messageRedirect_Submit('" + okUrl + "','"+ returnUrl +"');\"/></span>  <span class=\"button02\"><input type=\"button\" value=\""+g_cancel+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
	}else{
		document.getElementById("messageDivTitleMsgBottom").innerHTML = "<span class=\"button02\"><input type=\"button\" value=\""+g_cancel+"\" class=\"bold\" onclick=\"" + vCloseUrl + "\" /></span>";
	}
	neoDim("messageDivTitle_open");
}

// Layer message Redirect Url. 
function f_c_messageRedirect_Submit(url , redirect){
	document.n_messageDivPop.action = url;
	document.n_messageDivPop.returnUrl.value = redirect;
	document.n_messageDivPop.submit();
}

//Support Page 
function f_goPhoneClentMessage(applId,typeGubun){

		var loginCheckAjax = new getIsLoggedInAjax();
		if( loginCheckAjax.isLoggedIn == "true" ){
					  
			var url    = "web.common.PcClientDownloadAjax.dev";
			var myAjax = new Ajax.Request(
				url,
				{
					method 		 : 'POST',
					parameters 	 : {"applId" : applId, "typeGubun" : typeGubun},
					onComplete 	 : function(request) { 
									var obj = f_c_getJSONObj(request.responseXML);
									
									var error			= obj.body.error;
									var modelError		= obj.body.modelError;
									var smartPhoneYn	= obj.body.smartPhoneYn;
									var phoneClientFlag = obj.body.phoneClientFlag;
									if(error == 'false'){
										if(modelError == 'false'){
											if(smartPhoneYn == 'Y'){
												if(phoneClientFlag == 'Y'){
													f_c_messageDiv_open(g_btn_downloads,g_smssend, null, null);
												}else{
													f_c_messageDiv_open(g_btn_downloads,g_onlypcl, null, null);
												}
											}else{
												// model code not support POPUP Logic
												f_c_messageDiv_open(g_btn_downloads,g_notsupportphone, null, null);
											}
										}else{
											// odel code not support POPUP Logic
											f_c_messageDiv_open(g_btn_downloads,g_notsupportphone, null, null);
										}
									}else{
										//	download Error POPUP Logic
										f_c_messageDiv_open(g_btn_downloads,g_downloaderr, null, null);
									}
																		
								  },
					onFailure	 : function() {
									var str = '';
									    str += 'f_c_Download()' + '\n';
							            str += 'Failuer' + '\n';
							            alert(str);
					              },
					asynchronous : false
				}
			);		
		
		}else{
			var frm = document.hiddenForm;
			frm.applId.value 		= applId;
			frm.mncd1.value 		= "";
			frm.appl_section.value 	= typeGubun;
			frm.kwd.value 			= "";
			
			f_c_signInDiv_open();
		}		
	
}
	
	
//adroid by ish 201012 	 start
//Set Android Platform Version Combo start!!!!
function f_c_setAndroidPlatfomCombo(id,modelCode,selectedCode,applId){
		
		var comboObj = document.getElementById(id);
		var url = "web.common.retriveAndroidPlatformComboAjax.dev";
		
		if(applId!=null && applId.length>0){
			url = "web.common.retriveAndroidPlatformComboByApplIdAjax.dev";
		}
		
		f_c_removeAllOptions(id);	//initialize
		
		modelCode = modelCode.substring(0,modelCode.indexOf('-'));
		
		var myAjax = new Ajax.Request(
			url,
			{
				method : 'POST',
				parameters : {"modelCode":modelCode,"applId":applId},
				onComplete : function(request){
								var obj = f_c_getJSONObj(request.responseXML);
								var androidPlatformList = obj.body.androidPlatformList; 
								
								for(var i=0;i<androidPlatformList.length;i++){
									var code = androidPlatformList[i].code;
									var value = androidPlatformList[i].value;
									var selected = selectedCode==code?true:false;
									var opt = new Option(value,code,false,selected);
									comboObj.options.add(opt);
								}
								
								if(selectedCode==null && comboObj.options.length>0){
									comboObj.options[0].selected = true;
								}
				},
				onFailure : function(){
								f_c_messageDiv_open(null,'ajax failur', null, null);
				},
				asynchronous : false
			}
		);
}

function f_c_cancelComboPopup(comboId,errObjId){
		document.getElementById(comboId).options[0].selected = true;
		document.getElementById(errObjId).innerHTML='';
		neoClose(close);
} 

function f_c_removeAllOptions(comboId){
		var obj = document.getElementById(comboId);
		while(obj.options.length>0){
			var lastobj=obj.options[(obj.options.length-1)];
	  		obj.remove(lastobj.index);
		}
} 
//Set Android Platform Version Combo end!!!!!

//where the phone model changes - used in [register.jsp / myProfileEditPhone.jsp]
function f_c_showAndroidVersion(type){
	var phoneModelNoObj = document.getElementById("phoneModelNo"+type);
	var selectedObj = phoneModelNoObj.options[phoneModelNoObj.selectedIndex];
	var smartPhoneYn = selectedObj.getAttribute("smartPhoneYn");
	var modelCode = selectedObj.value;
	
	if(smartPhoneYn=="A"){
		document.getElementById("dlAndrPlatform"+type).style.display = "block";
		document.getElementById("andrPlatformCode"+type).disabled = false;
		f_c_setAndroidPlatfomCombo("andrPlatformCode"+type,modelCode);		
		showGT540Msg('gt540Msg'+type,modelCode);
	}else{
		if(document.getElementById("andrPlatformCode"+type).options.length>0){
			document.getElementById("andrPlatformCode"+type).options[0].selected = true;
		}
		document.getElementById("andrPlatformCode"+type).disabled = true;
		document.getElementById("dlAndrPlatform"+type).style.display = "none";
	}
} 
//android download popup//


//download popup initiation - common_biz.jsp
function f_c_open_androidDownloadPopup(applId, typeGubun,obj){
	
	//user's platform info
	var platformCode 	= obj.body.platformCode;
	var platformName 	= obj.body.platformName; 	
	var modelCode 		= obj.body.modelCode; 	
	
	//initiation	
	f_c_setAndroidPlatfomCombo("neo2_4-1",modelCode,platformCode,applId);	//set data of select box
	//document.getElementById('platformNameSpan_androidDownPopupDiv').innerHTML = platformName;	//show user platform name
	//document.getElementById('editPlatformCodeDiv_androidDownPopupDiv').style.display = 'none';
	//showGT540Msg('gt540Msg_androidDownPopupDiv',modelCode);
	document.getElementById('androidGuideDiv').style.display ='none';
	//set edit button
	//document.getElementById('editBtn_androidDownPopupDiv').onclick = function(){
		//document.getElementById('editPlatformCodeDiv_androidDownPopupDiv').style.display = 'block';
	//};
	//set ok button	
	document.getElementById('okBtn_androidDownPopupDiv').onclick = function(){//change platformCode	
		if(document.getElementById('androidGuideDiv').style.display!='none'){	
			var platformCode = document.getElementById('neo2_4-1').value;				
			if(platformCode==''){
				document.getElementById('platformCodeErr_androidDownPopupDiv').style.display = 'block';
				return;
			}				
			f_c_updatePlatformCode_downloading(platformCode,applId, typeGubun); //change platform & download
		}else{
			neoClose(close);					
			f_c_download_after(applId, typeGubun, 'true');
		}		
	};
	
	//show
	neoDim("androidDownPopupDiv_open");
}

function androidGuideOpen(){
	document.getElementById('androidGuideDiv').style.display = 'block';
}
//update platformCode in download popup
function f_c_updatePlatformCode_downloading(platformCode,applId, typeGubun){
		var url = "web.common.updatePlatformCodeInDownloadPopupAjax.dev";	//update platform
		var myAjax = new Ajax.Request(
			url,
			{
				method : 'POST',
				parameters : {"newPlatformCode":platformCode},
				onComplete : function(request){								
								var obj = f_c_getJSONObj(request.responseXML);
								var isSuccess = new Number(obj.body.isSuccess).valueOf(); //0:failed ,1:success , 2: not changed 
								
								switch(isSuccess){
								
									case 0 :	var errMsg = g_androidVerMessage23 + "<br/>" + g_androidVerMessage24;
												f_c_messageDiv_open(null,errMsg, null, null); break;
									
									case 1 :	window.onfocus = function(){
													window.onfocus = null;
													f_c_reloadingAfterAndroidSideLoading();		//common_biz.jsp
												};		
												
												document.getElementById('editBtn_androidDownPopupDiv').disabled = true;	//disable button
												document.getElementById('okBtn_androidDownPopupDiv').disabled = true;	
												document.getElementById('neo2_4-1').disabled = true;	
																				
												f_c_download_after(applId, typeGubun, 'true');	break;
									
									case 2 :	neoClose(close);	
												f_c_download_after(applId, typeGubun, 'true');
												
								}
				},
				onFailure : function(){
								f_c_messageDiv_open(null,'ajax failur', null, null);
				},
				asynchronous : false
			}
		);
}

//update PhoneNo in download popup
function f_c_updatePhoneNo_downloading(applId,typeGubun,phoneCheck,phoneNo){
		var url = "web.common.UpdatePhoneNoInDownloadPopupAjax.dev";	//update platform
		var myAjax = new Ajax.Request(
			url,
			{
				method : 'POST',
				parameters : {"phoneNo":phoneNo},
				onComplete : function(request){								
								var obj = f_c_getJSONObj(request.responseXML);
								var isSuccess = obj.body.isSuccess; //0:failed ,1:success , 2: not changed 
								
								if(isSuccess=='0'){
									var errMsg = g_androidVerMessage23 ;
									f_c_messageDiv_open(null,errMsg, null, null);	//phone number update fail
									 return;
								}
								
								neoClose(close);	
								f_c_download_after(applId, typeGubun, phoneCheck);
																
				},
				onFailure : function(){
								f_c_messageDiv_open(null,'ajax failur', null, null);
				},
				asynchronous : false
			}
		);
}

  
//click edit user phone No. in the download popup (feature phone) 
function f_c_click_downloadConfirmBtn(applId,typeGubun,phoneCheck){
	
	var box = document.getElementById('editUserPhoneInfoDiv');
	applId = document.hiddenForm.applId.value; //2011.05.02 KIM MYONG JONG
	//check format
	if(box.style.display != 'none'){
	
		var phoneNoObj = document.getElementById('phoneNo_editUserPhoneInfoDiv');
		var errObj = document.getElementById('errorPassMsg_editUserPhoneInfoDiv');
		
		if(phoneNoObj.value.trim()==""){
			errObj.innerHTML = '<img alt="caution" src="'+g_erroricon01 + '">' + g_phoneNumber;
			errObj.style.display = "block";
			phoneNoObj.focus();
			return;
		}
		
		if(!phoneNoObj.value.isnumber()){
			errObj.innerHTML = '<img alt="caution" src="'+g_erroricon01 + '">' + g_onlynumbers;
			errObj.style.display = "block";
			phoneNoObj.focus();
			return;
		}
		
		f_c_updatePhoneNo_downloading(applId,typeGubun,phoneCheck,phoneNoObj.value.trim());
		
	}else{
	
		neoClose(close);
		f_c_download_after(applId,typeGubun,phoneCheck);
	}
}

//phone select popup
function f_c_savePlatformCode(){
	var platformCode = document.getElementById("platformCode_phoneSelectAndrPlatform_layer").value;
	if(platformCode == ''){
		document.getElementById("platformCodeErrMsg_phoneSelectAndrPlatform_layer").style.display = 'block';
	}else{
		document.getElementById('okBtn_phoneSelectAndrPlatform_layer').disabled = true;
		var modelCode = document.getElementById("_userMocdelCode").value;
		f_userPhoenChangeAjax(modelCode,platformCode);
	}
}


function f_goAndroidMessage(applId,typeGubun){

		var loginCheckAjax = new getIsLoggedInAjax();
		if( loginCheckAjax.isLoggedIn == "true" ){
					  
			var url    = "web.common.AndroidDownloadAjax.dev";
			var myAjax = new Ajax.Request(
				url,
				{
					method 		 : 'POST',
					parameters 	 : {"applId" : applId, "typeGubun" : typeGubun},
					onComplete 	 : function(request) { 
									var obj = f_c_getJSONObj(request.responseXML);
									
									var error			= obj.body.error;
									var modelError		= obj.body.modelError;
									var smartPhoneYn	= obj.body.smartPhoneYn;
									if(error == 'false'){
										if(modelError == 'false'){
											if(smartPhoneYn == 'A'){
													f_c_messageDiv_open(g_btn_downloads,g_smssend, null, null);
											}else{
												// model code not support POPUP Logic
												f_c_messageDiv_open(g_btn_downloads,g_notsupportphone, null, null);
											}
										}else{
											// model code not suppor POPUP Logic
											f_c_messageDiv_open(g_btn_downloads,g_notsupportphone, null, null);
										}
									}else{
										//	download Error POPUP Logic
										f_c_messageDiv_open(g_btn_downloads,g_downloaderr, null, null);
									}
																		
								  },
					onFailure	 : function() {
									var str = '';
									    str += 'f_c_Download()' + '\n';
							            str += 'Failuer' + '\n';
							            alert(str);
					              },
					asynchronous : false
				}
			);		
		
		}else{
			var frm = document.hiddenForm;
			frm.applId.value 		= applId;
			frm.mncd1.value 		= "";
			frm.appl_section.value 	= typeGubun;
			frm.kwd.value 			= "";
			
			f_c_signInDiv_open();
		}		
}

function showGT540Msg(msgId,selectedModelCode){
	var ModelCode = 'GT540-'+g_countryCode;	
	if(ModelCode == selectedModelCode){
		document.getElementById(msgId).style.display = 'block';
	}else{
		document.getElementById(msgId).style.display = 'none';
	}
}

function f_goPhoneNumChk(){
	var loginCheckAjax = new getIsLoggedInAjax();
	if( loginCheckAjax.isLoggedIn == "true" ){
	
		var url    = "web.common.AndroidPhoneNumChkAjax.dev";
		var myAjax = new Ajax.Request(
			url,
			{
				method : 'POST',
				parameters : {},
				onComplete : function(request){
					var obj = f_c_getJSONObj(request.responseXML);

					setUserPhoneChkInfo(obj);
					neoDim("androidCheckDiv_open");
				},
				onFailure : function(){
					f_c_messageDiv_open(null,'ajax failur', null, null);
				},
				asynchronous : false
			}
		);
	}else{
		f_c_signInDiv_open();
	}
}

//click edit user android phone No. in the apk file download popup (android phone) 
function f_c_apkDownloadConfirmBtn(){
	
	var phoneNoObj = document.getElementById('phNo_apkEditUserPhone');
	var errObj = document.getElementById('err_apkEditUserPhone');
	
	if(phoneNoObj.value.trim()==""){
		errObj.innerHTML = '<img alt="caution" src="'+g_erroricon01 + '">' + g_phoneNumber;
		errObj.style.display = "block";
		phoneNoObj.focus();
		return;
	}
	
	f_c_updatePhoneNo_apkDown(phoneNoObj.value.trim());
	
}

function f_c_updatePhoneNo_apkDown(phoneNo){
	var url = "web.common.UpdatePhoneNoInDownloadPopupAjax.dev";	//update platform
		var myAjax = new Ajax.Request(
			url,
			{
				method : 'POST',
				parameters : {"phoneNo":phoneNo},
				onComplete : function(request){
								var obj = f_c_getJSONObj(request.responseXML);
								var isSuccess = obj.body.isSuccess; //0:failed ,1:success , 2: not changed
								
								if(isSuccess=='0'){
									var errMsg = g_updatefail;
									f_c_messageDiv_open(null,errMsg, null, null);	//phone number update fail
									 return;
								}
								
								neoClose('androidCheckDiv_open');
								f_goAndroidMessage('pcGuide','AH');
																
				},
				onFailure : function(){
								f_c_messageDiv_open(null,'ajax failur', null, null);
				},
				asynchronous : false
			}
		);
}

function f_c_dupRegister() {
    neoClose("signDupFlagCheckDiv");
    
    var form = document.dupFlagCheckForm;
    form.action = "/web.member.register.dev";
    form.submit();
}

function f_c_apkClientVerDownload(){

    var url = "web.common.apkClientVerDownloadAjax.dev";
    var eicUrl = "http://www"+g_lgUrl+"/web.common.apkFileDownload.dev?countryCode="+g_countryCode+"&languageCode="+g_languageCode
               + "&modelCode="+g_userModel+"&ricCode="+g_ricCode+"&platForm="+g_platForm+"&vercheck=Y";
           
    var myAjax = new Ajax.Request(
        url,
        {
            method : 'POST',
            parameters : {},
            onComplete : function(request){
                              var obj = f_c_getJSONObj(request.responseXML);
                              var checkYn = obj.body.checkYn;
                              
                              var errMsg = "";
                              if(checkYn == 'P'){
                                  errMsg = g_notsupportphone;
                                  f_c_messageDiv_open(null,errMsg, null, null);
                                  return;
                                  
                              }else if(checkYn == 'N'){
                                   errMsg = g_androidVerMessage20;
                                  f_c_messageDiv_open(null,errMsg, null, null);
                                  return;
                                  
                              }else if(checkYn == 'Y'){
	                                if(g_ricCode == "EIC"){
	                                    window.location.href = eicUrl;
	                                }else{
	                                    window.location.href = "web.common.apkFileDownload.dev";
	                                }
                              }
            },
            onFailure : function(){
                f_c_messageDiv_open(null,'ajax failur', null, null);
            },
            asynchronous : false
        }
    );
}

function f_message_tutorial(){
    neoClose(close);
    
    document.menuForm.mncd1.value       = "ASF_05_00";
    document.menuForm.mncd2.value       = "C03";
    document.menuForm.pageGubun.value   = "7";
    
    document.menuForm.action = "web.support.RetrievePhoneModelTutorial.dev";
    document.menuForm.submit();
    
}

function f_c_privacyPop(){
	 window.open("web.member.PrivacyAjaxData.dev","popUp", "width=621px, height=540px");
	 return;
}

function f_c_privacyUpdate() {
    neoClose("privacyCheckDiv");
    
    var form = document.privacyCheckForm;
    form.action = "/web.member.PrivacyUpdate.dev";
    form.submit();
}


