function goSearch(){
    searchForm.submit();
}

function itemToCart(idx,amount){
    var goUrl = "/shop/shopping/cart_save.jsp?actionflag=insertItem&idx="+idx+"&amount="+amount;
    window.location = goUrl;
}

function packageToCart(idx,amount){
    var goUrl = "/shop/shopping/cart_save.jsp?actionflag=insertPackage&idx="+idx+"&amount="+amount;
    window.location = goUrl;
}


function itemOrder(idx,amount){
    //alert( idx +":"+ amount);        
    var goUrl = "/shop/shopping/order/order_inputmyinfo.jsp?idx="+idx+"&amount="+amount+"&gubun=item";
    window.location = goUrl;
}

function packageOrder(idx,amount){
    //alert( idx +":"+ amount);
    var goUrl = "/shop/shopping/order/order_inputmyinfo.jsp?idx="+idx+"&amount="+amount+"&gubun=pack";
    window.location = goUrl;
}

function itemToMyBox(idx){
    //alert( idx );
    var goUrl = "/service/customer/mybox_save.jsp?actionflag=insert&item_idx=" + idx;
    window.location = goUrl;
}


function popupDemoSong(idx){
    var page = "/shop/pop/stream_sound.jsp?item_idx=" + idx;
    window.open(page,'stream_sound','menubar=no,toolbar=no,directories=no,status=no,path=no,left=0,top=0,width=368,height=140,');
}

function popupMovie(idx){
    var page = "/shop/pop/stream_video.jsp?item_idx=" + idx;
    window.open(page,'stream_video','menubar=no,toolbar=no,directories=no,status=no,path=no,left=0,top=0,width=368,height=400,');
}

function compareShoppingItem(){
    var COMP_MAX = 2;
    var ct = 0;
    var items = document.all.checkedItem;
    var goUrl = "/shop/shopping/shop_compare.jsp?";
    
    for( var i=0; i< items.length; i++){        
        
        if( items[i].checked  ){
            goUrl = goUrl+"item_idx="+items[i].value+"&";
            ct++;
        }
    }
    
    if( ct > COMP_MAX  ){
        alert( "»óÇ°ºñ±³´Â " +COMP_MAX+"°³ ±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù"  );
        return;
    }
    if( ct <= 1  ){
        alert("ºñ±³ÇÒ »óÇ°À» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä");
        return;
    }
    window.location = goUrl;
}

function compareBrochureItem(){
    var COMP_MAX = 2;
    var ct = 0;
    var items = document.all.checkedItem;
    var goUrl = "/shop/brochure/brochure_compare.jsp?";
    
    for( var i=0; i< items.length; i++){        
        
        if( items[i].checked  ){
            goUrl = goUrl+"item_idx="+items[i].value+"&";
            ct++;
        }
    }
    
    if( ct > COMP_MAX  ){
        alert( "»óÇ°ºñ±³´Â " +COMP_MAX+"°³ ±îÁö¸¸ °¡´ÉÇÕ´Ï´Ù"  );
        return;
    }
    if( ct <= 1  ){
        alert("ºñ±³ÇÒ »óÇ°À» ¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿ä");
        return;
    }
    window.location = goUrl;
}

function view_attach(fileName){
    //window.open('/common/function/download.jsp?fileName='+fileName,'view_attach','left=0,top=0,width=600,height=400,');
    window.location = "/common/function/download.jsp?fileName="+ escape(fileName);
}

function view_big_image(idx){
    var page = "/shop/pop/large_view.jsp?item_idx=" + idx;
    window.open(page,'view_big_image','menubar=no,toolbar=no,directories=no,scrollbars=yes,resizable=yes,status=no,path=no,left=0,top=0,width=600,height=400,');
}

function print_item(idx,gubun){
    var page;
    if( "shopping" == gubun ){
        page = "/shop/shopping/print_view.jsp?item_idx=" + idx;
    }else{
        page = "/shop/brochure/print_view.jsp?item_idx=" + idx;    
    }
    window.open(page,'print_item','menubar=no,toolbar=no,directories=no,status=no,path=no,left=0,top=0,width=600,height=700,scrollbars=yes');
}

function mail_item(item_idx ){

    var page = "/shop/item_mail.jsp?item_idx=" + item_idx;
    window.open(page,'item_mail','menubar=no,toolbar=no,directories=no,status=no,path=no,left=0,top=0,width=600,height=300,scrollbars=yes');
}

function item_price_mail(item_nm){
    var page = "/common/mail/formmail/item_price_mail.jsp?item_nm="+item_nm;    
    window.open(page,'item_price_mail','menubar=no,toolbar=no,directories=no,status=no,path=no,left=0,top=0,width=600,height=600,scrollbars=yes');
}

//2004.12.29
function sale_price_mail(item_nm, price){
    var page = "/common/mail/formmail/sale_price_mail.jsp?item_nm="+item_nm+"&sale_price="+price;
    window.open(page,'item_price_mail','menubar=no,toolbar=no,directories=no,status=no,path=no,left=0,top=0,width=600,height=600,scrollbars=yes');
}
