/**
 * @fileoverview 제품 Front Feature 스크립트
 * @author realsnake@netville.co.kr
 * @version 1.0.0
 * @since 2009.06.08
 */

        //popup 호출     
        function gotoPage(index){
            
            if(index == "m1"){
                goVrWindow();
            }else if(index == "m2"){
                goCatalogWindow();
            }else{
                goFlashWindow(index);
            }
        }

        //popup vr
        function goVrWindow(){
        
            var title = "vrlink";
            var action = "";
            var width = 800;
            var height = 700;
            if(nv.BrowserDetector.isIE){
                action = "productPopupView.do?forward=vrView&prdCtgSeq="+prdCtgSeq.value+"&langPrdSeq="+langPrdSeq.value;
                nv.Popup.open(action, title, width, height, "no", "no");
            }else{
                action = "productPopupView.do?forward=sorryWindow&pageType=3dView&prdCtgSeq="+prdCtgSeq.value+"&langPrdSeq="+langPrdSeq.value;
                title = "sorry";
                nv.Popup.open(action, title, width, height, "no", "no");
            }
        }
        
        //xml flash//새창 
        function goFlashWindow(flashUrl){
           
           var flashWindow = document.getElementById("flashWindow");
           var url =  "<netville:config key='server.config.web-server'/>"+flashUrl;
           var winType = "fullscreen=yes";
           
           if(nv.BrowserDetector.isIE){
               flashWindow.href = url;
               flashWindow.click();
           }else{
               window.open(url,"",winType);
           }         
        }
        
        //popup catalog
        function goCatalogWindow(){
            
            var action = "";
            var title = "";
            var width = 800;
            var height = 700;    
            if(nv.BrowserDetector.isIE){
                action = "productPopupView.do?forward=catalogView&prdCtgSeq="+prdCtgSeq.value+"&langPrdSeq="+langPrdSeq.value;
                nv.Popup.open(action, title, width, height, "no", "no");
            }else{
                action = "productPopupView.do?forward=sorryWindow&pageType=cataolg&prdCtgSeq="+prdCtgSeq.value+"&langPrdSeq="+langPrdSeq.value;
                title = "sorry";
                nv.Popup.open(action, title, width, height, "no", "no");
            }
        } 

        function productPopupView(prjSeq, modeSeq) {
            
            var width = 710;
            var height = 700;
            var title = "";
            var action = "productPopupView.do?forward=salesPointView&prjSeq="+prjSeq+"&langPrdSeq="+langPrdSeq.value+"&modeSeq="+modeSeq;
            nv.Popup.open(action, title, width, height, "no", "no");
        }
        
        //skill tech DWR 호출
        function getSkillTechContents(messageId) {
            var skillTitle = document.getElementById("skillTitle_"+messageId);
            var skillViewCnt = document.getElementById("skillViewCnt_"+messageId);
            var skillStartDate = document.getElementById("skillStartDate_"+messageId);
            var skillAndTechViewCnt = document.getElementById("skillAndTechViewCnt");
            var skillAndTechTitle = document.getElementById("skillAndTechTitle");
            
            skillAndTechViewCnt.innerHTML = "";
            skillAndTechViewCnt.innerHTML = "View <span class='pink'>"+skillViewCnt.value+"</span> | "+skillStartDate.value ;
            skillAndTechTitle.innerHTML = "";
            skillAndTechTitle.innerHTML = skillTitle.value;
            
            ProductDWR.getSkillTechniqueContents(messageId, returnGetSkillTechContents ,false);   
        }
        
        //skill tech DWR 리턴 함수
        function returnGetSkillTechContents(message) {
           var skillAndTechMainContent = document.getElementById("skillAndTechMainContent");
           skillAndTechMainContent.innerHTML = "";
           skillAndTechMainContent.innerHTML = message.contents;
        }
        
        function getExpertReviewContents(messageId) {
            var expertTitle = document.getElementById("expertTitle_"+messageId);
            var expertViewCnt = document.getElementById("expertViewCnt_"+messageId);
            var expertStartDate = document.getElementById("expertStartDate_"+messageId);
            var expertReviewViewCnt = document.getElementById("expertReviewViewCnt");
            var expertReviewTitle = document.getElementById("expertReviewTitle");
            
            expertReviewViewCnt.innerHTML = "";
            expertReviewViewCnt.innerHTML = "View <span class='pink'>"+expertViewCnt.value+"</span> | "+expertStartDate.value ;
            expertReviewTitle.innerHTML = "";
            expertReviewTitle.innerHTML = expertTitle.value;
            
            ProductDWR.getSkillTechniqueContents(messageId, returnGetExpertReviewContents ,false);    
        }
        
        function returnGetExpertReviewContents(message) {
        
            var expertReviewMainContent = document.getElementById("expertReviewMainContent");
            expertReviewMainContent.innerHTML = "";
            expertReviewMainContent.innerHTML = message.contents;
        }
        
        //제품관련 제품 
        function goRealtedProduct(prdCtgSeq , langPrdSeq) {
            document.location.href="productDetailView.do?forward=feature&prdCtgSeq="+prdCtgSeq+"&langPrdSeq="+langPrdSeq;
        }
        //agreemnet popup
        function goAgreementPoppuWindow(prdFileSeq , fileType){
            
            var width = 600;
            var height = 650;
            var title = "";
            action = "productPopupView.do?forward=downloadWindow&prdCtgSeq="+prdCtgSeq.value+"&langPrdSeq="+langPrdSeq.value+"&fileSeq="+prdFileSeq+"&fileType="+fileType+"&pageType=agreement";
            nv.Popup.open(action, title, width, height, "yes", "no");
        }
        
        //special feature Content popup
        function specialPopupView(prdSpecialFeatureSeq) {
            
            var width = 450;
            var height = 550;
            var title = "";
            var action = "productPopupView.do?forward=specialFeatureView&langPrdSeq=0&prdSpecialFeatureSeq="+prdSpecialFeatureSeq;
            nv.Popup.open(action, title, width, height, "no", "no");
        }
        //MapviewAgree
        function goMapviewAgreePoppuWindow(prdFileSeq , fileType){
            
            var width = 600;
            var height = 650;
            var title = "";
            action = "productPopupView.do?forward=mapViewDownloadListWindow&prdCtgSeq="+prdCtgSeq.value+"&langPrdSeq="+langPrdSeq.value+"&fileSeq="+prdFileSeq+"&fileType="+fileType;
            nv.Popup.open(action, title, width, height, "yes", "no");
        }
  
      
