



var item_win;
var objPreviewInfo = new Object();
function item_view(type, itemid,fn,sort,additive_info){
 if(!fn){
 fn = document.frmItemView; if(typeof(fn) == 'undefined'){
 setItemViewForm(); fn = document.getElementById('frmItemView'); }
 }
 strUrl = "about:blank"; 
 frmAction = "/mall/item_view_ps.php"; strName = "itemViewwindow"; 
 
 if(item_win){
 if(!item_win.closed){
 item_win.close(); 
 }
 }
 
 if(top.parent.frmHidden){
 recive_id = top.parent.frmHidden.document.getElementById("recive_id").value; recive_name = top.parent.frmHidden.document.getElementById("recive_name").value; frmAction = frmAction + "?recive_id=" + recive_id + "&recive_name=" + recive_name; }

 
 item_win = winMallOpen(frmAction,strName); 
 fn.action=frmAction; 
 fn.intItemid.value=itemid; fn.type.value=type; for(var key in objPreviewInfo){
 var sort = objPreviewInfo[key]; }
 if(additive_info){
 for(var key in additive_info){
 if(document.getElementById(key)){
 document.getElementById(key).value = additive_info[key]; }
 }
 }
 
 if(sort){
 fn.sort.value = sort; } 
 fn.submit();}

function blog_view(itemid,param){
 var fn = document.frmItemView; if(typeof(fn) == 'undefined'){
 setItemViewForm(); fn = document.getElementById('frmItemView'); }
 if(item_win){
 if(!item_win.closed){
 item_win.close(); }
 }
 
 if(top.parent.frmHidden){
 recive_id = top.parent.frmHidden.document.getElementById("recive_id").value; recive_name = top.parent.frmHidden.document.getElementById("recive_name").value; frmAction = frmAction + "?recive_id=" + recive_id + "&recive_name=" + recive_name; }
 
 frmAction = "/mall3/blog/item_view_blog.php"; strName = "blogItemViewWindow"; fn.target = strName; fn.action=frmAction; 
 fn.intItemid.value=itemid; if(typeof param != 'undefined'){
 fn.extend_info = param; }
 for(var key in objPreviewInfo){
 sort = objPreviewInfo[key]; }
 
 if(sort){
 fn.sort.value = sort; } 
 item_win = winMallOpen(frmAction,strName); fn.submit();}


function setItemViewForm(){
 var formNode = document.createElement("form"); var inputItemidNode = document.createElement("input"); var inputTypeNode = document.createElement("input"); var inputExtendInfo = document.createElement("input"); var inputSort = document.createElement("input"); var inputGroupItem = document.createElement("input"); formNode.setAttribute("name","frmItemView"); formNode.setAttribute("id","frmItemView"); formNode.setAttribute("method","post"); formNode.setAttribute("target","itemViewwindow"); inputItemidNode.setAttribute("type","hidden"); inputItemidNode.setAttribute("name","intItemid"); inputItemidNode.setAttribute("id","intItemid"); 
 inputTypeNode.setAttribute("type","hidden"); inputTypeNode.setAttribute("name","type"); inputTypeNode.setAttribute("id","type"); 
 inputExtendInfo.setAttribute("type","hidden"); inputExtendInfo.setAttribute("name","extend_info"); inputExtendInfo.setAttribute("id","extend_info"); 
 inputSort.setAttribute("type","hidden"); inputSort.setAttribute("name","sort"); inputSort.setAttribute("id","sort"); 
 inputGroupItem.setAttribute("type","hidden"); inputGroupItem.setAttribute("name","groupItem"); inputGroupItem.setAttribute("id","groupItem"); 
 formNode.appendChild(inputItemidNode); formNode.appendChild(inputTypeNode); document.body.appendChild(formNode);}
function shop_popup(popup_where){
 var return_url = document.location; switch(popup_where){
 case("cymoney_present"):
 strUrl = "/mall/cymoney_present.php"; if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "?recive_id=" + recive_id + "&recive_name=" + recive_name; }
 strName = "CymoneyPresentWindow"; WinWidth = 388; WinHeight = 310; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; break; case("fill"):
 strUrl = "/mall/fill.php?return_url="+return_url; strName = "CyMoneyFillWindow"; WinWidth = 438; WinHeight = 335; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; break; case("gift_check"):
 strUrl = "about:blank"; strName = "GiftChecklWindow"; WinWidth = 388; WinHeight = 390; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; break; case("gift_reject"):
 strUrl = "about:blank"; strName = "winGiftRejectPop"; WinWidth = 388; WinHeight = 343; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; window.close(); break; case("appeal_list"):
 strUrl = "/mall/appeal_list.php"; strName = "winAppealPop"; WinWidth = 438; WinHeight = 445; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; break; case("appeal_view"):
 strUrl = "about:blank"; strName = "winAppealViewPop"; WinWidth = 388; WinHeight = 311; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; break; case("coupon"):
 strUrl = "/mall/coupon_list.php"; strName = "winCouponPop"; WinWidth = 438; WinHeight = 390; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; break; }
 shop_popup_win = WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty); return(shop_popup_win);}


function submit_pop_up(submit_mode, fn, msg_option){
 var msg; var strName = "Proc_And_Msg_Win"; var strUrl = "about:blank"; var ScrollBar = "no"; var Resize = "no"; var WinGubun = "Center"; var strProperty = ""; var msg_check; var window_close_chk = true; switch(submit_mode){
 case("cymoney_check"):
 WinWidth = 274; WinHeight = 140; if(fn.ChkValues){
 if(fn.ChkValues.value == ""){
 alert(str_msg_select_items); submit_chk = false; return(false); }
 }
 if(fn.recive_info){
 if(!fn.recive_info.value){
 alert(str_msg_select_friend); fn.recive_info.focus(); submit_chk = false; return(false); }
 }
 if(fn.send_comment){
 if(fn.send_comment.value == ""){
 alert(str_msg_input_message); fn.send_comment.focus(); submit_chk = false; return(false); }
 if(wordFilter(fn.send_comment.value,'B')){
 fn.send_comment.focus(); submit_chk = false; return(false); }
 }
 break; case("item_buy"):
 WinWidth = 388; WinHeight = 160; if(fn.ChkValues){
 if(fn.ChkValues.value == ""){
 alert(str_msg_select_items); submit_chk = false; return(false); }
 }
 break; case("gift_accept"):
 fn.action = "gift_check_C_accept_confirm.php"; WinWidth = 488; WinHeight = 220; if(fn.gift_comment){
 if(wordFilter(fn.gift_comment.value,'B')){
 fn.gift_comment.focus(); submit_chk = false; return(false); }
 }
 break; case("gift_accept_completed"):
 fn.action = "gift_check_accept.php"; WinWidth = 247; WinHeight = 140; break; case("gift"):
 WinWidth = 288; WinHeight = 140; if(fn.recive_info){
 if(!fn.recive_info.value){
 alert(str_msg_select_friend); fn.recive_info.focus(); submit_chk = false; return(false); }
 }
 if(fn.ChkValues){
 if(fn.ChkValues.value == ""){
 alert(str_msg_select_items); submit_chk = false; return(false); }
 }
 if(wordFilter(fn.send_comment.value,'B')){
 fn.send_comment.focus(); submit_chk = false; return(false); }
 break; case("appeal_delete"):
 if(ChkStateCheck() == true){
 WinWidth = 288; WinHeight = 140; ChkSelValues(fn); fn.action = "/mall/delete_C_check.php"; window_close_chk = false; }
 else{
 alert(str_msg_check_one); return(false); submit_chk = false; }
 break; case("appeal"):
 msg = str_msg_appeal; 
 var submit_chk = true; if(fn.ChkValues){
 if(fn.ChkValues.value == ""){
 alert(str_msg_select_items); submit_chk = false; return(false); }
 }
 if(fn.recive_info.type == "select-one"){
 if(fn.recive_info.options[fn.recive_info.selectedIndex].value == ""){
 alert(str_msg_select_friend); fn.recive_info.focus(); submit_chk = false; return(false); }
 }
 else{
 if(fn.recive_info.value == ""){
 alert(str_msg_select_friend); fn.recive_info.focus(); submit_chk = false; return(false); }
 }
 if(fn.send_comment.value == ""){
 alert(str_msg_input_message); fn.send_comment.focus(); submit_chk = false; return(false); }
 if(wordFilter(fn.send_comment.value,'B')){
 fn.send_comment.focus(); submit_chk = false; return(false); }
 WinWidth = 247; WinHeight = 140; break; }
 if(submit_chk != false){
 if(msg){msg_check = message_check(msg);}else{msg_check = true;}
 if(msg_check == true){
 if(window.name == "Proc_And_Msg_Win"){
 window.name = "Proc_And_Msg_Win_old"; }
 if(window_close_chk == true){window.close();}
 msg_popup_win = WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty); if(msg_popup_win){msg_popup_win.focus();}
 fn.submit(); }
 }
 else{
 return(false); }
}

function w_close(){
 window.close();}

function go_gift_box(){
 opener.location.href="/mycy/mall/myitem_gift_recive.php"; opener.focus(); window.close();}

function giftChk(check_mode, myitem_id){
 switch(check_mode){
 case("accept_confirm"):
 fn = document.frmGift_check; fn.action = "./gift_check_C_accept_confirm.php"; fn.target = "fraGiftHidden"; if(fn.gift_comment.value){
 if(wordFilter(fn.gift_comment.value,'B')){
 return; }
 if(fn.action != ""){fn.submit();}else{fn.action = "";}
 }
 else{
 alert(str_msg_input_message); }
 break; case("accept"):
 fn = document.frmGift_check; fn.action = "./gift_check_accept.php"; if(fn.gift_comment.value){
 if(wordFilter(fn.gift_comment.value,'B')){
 return; }
 if(fn.action != ""){fn.submit();}else{fn.action = "";}
 }
 else{
 alert(str_msg_input_message); }
 break; case("reject"):
 shop_popup("gift_reject"); document.frmGift_check.action = "./gift_check_reject.php"; document.frmGift_check.target = "winGiftRejectPop"; document.frmGift_check.submit(); break; case("reject_completed"):
 fn = document.frmGift_reject; if(fn.gift_comment){
 if(wordFilter(fn.gift_comment.value,'B')){
 return; }
 }
 msg = str_gift_reject_confirm; if(confirm(msg)){
 fn.submit(); }
 break; case("check"):
 fn = document.frmGift_check; if(fn){
 fn.myitem_id.value = myitem_id; }
 gift_win = shop_popup('gift_check'); fn.submit(); break; }

}
function appeal_popup(AppealMode, AppealID){
 var fn = document.frmAppeal; switch(AppealMode){
 case("view"): 
 shop_popup_win = WinOpen("/mall/appeal_view.php?appeal_id="+AppealID,"winAppealViewPop",388,311,"no","no","Center",""); 
 break; case("gift"):
 fn.action = "/mall/gift.php"; fn.target = "itemBuyWindow"; fn.ChkValues.value = AppealID; if(fn.action){
 strUrl = "about:blank"; strName = "itemBuyWindow"; WinWidth = 388; WinHeight = 375; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; w_close(); item_win = WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty); fn.submit(); return(true); }
 else{
 return(false); }
 break; case("delete"):
 msg = str_msg_delete; if(confirm(msg)){
 fn.action = "/mall/appeal_delete.php"; fn.target = "fraAppealHidden"; fn.ChkValues.value = AppealID; if(fn.action){
 fn.submit(); return(true); }
 else{
 return(false); }
 }
 else{
 return(false); }
 break; case("preview"):
 if(AppealID){
 fn.target = "itemViewwindow"; strItemtype = fn.item_type.value; item_view(eval(strItemtype), AppealID, fn);
 }
 else{
 alert(str_item_id_is_null); return(false); }
 break; case("exit"):
 msg = str_gift_later; if(confirm(msg)){
 window.close(); }
 break; }
}
function msg_display(msg_code, msg_option1, msg_option2){
 switch(msg_code){
 default:
 return_msg = msg[msg_code]; break; case(0):
 return_msg = msg_option1+msg[msg_code];
 break; }
 return(return_msg);}
function coverstory_submit(){
 document.frmCoverstory.submit();}

function item_search(fn,input_search_text){
 if(input_search_text){
 fn.search_text.value = input_search_text; }
 if(fn.search_text.value.length = 0 || fn.search_text.value.length < 2){
 alert(str_search_text_short); }
 else{
 fn.submit(); }
}


function search_friend(){
 strUrl = "/main/buddy/pop_buddy_search.php?mode=none"; strName = "WinSearchBuddy"; WinWidth = 420; WinHeight = 397; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; item_win = WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty); 
 document.getElementById("send_type").innerHTML= "<a href=javascript:select_friend_from_buddy_list_box(); class='verdana or p12 u ls'>" + decodeURIComponent("%E6%90%9C%E7%B4%A2%E7%9F%A5%E5%B7%B1%E4%BB%A5%E5%A4%96%E7%9A%84%E4%BA%BA") +"</a>"; if(chk_broswer() == true){
 document.getElementById("layBuddySel").innerHTML = document.getElementById("divBuddyInput").innerHTML; }
 else{
 document.getElementById("divBuddySel").selectedIndex = 0; document.getElementById("divBuddySel").style.visibility = "hidden"; document.getElementById("divBuddyInput").style.visibility = "visible"; document.getElementById("recive_info").value=""; }
}
function select_friend_from_buddy_list_box(){
 
 document.getElementById("send_type").innerHTML= "<a href=javascript:search_friend(); class='verdana or p12 u ls'>" + decodeURIComponent("%E6%90%9C%E7%B4%A2%E7%9F%A5%E5%B7%B1%E4%BB%A5%E5%A4%96%E7%9A%84%E4%BA%BA") + "</a>"; if(chk_broswer() == true){
 document.getElementById("layBuddySel").innerHTML = document.getElementById("divBuddySel").innerHTML; }
 else{
 document.getElementById("divBuddyInput").value=""; document.getElementById("divBuddyInput").style.visibility = "hidden"; document.getElementById("divBuddySel").style.visibility = "visible"; document.getElementById("recive_info").value=""; }
}
function set_payment(pay_sel){
 fn = document.frmFill;
 

 switch(eval(pay_sel.selectedIndex)){
 default:

 fn.action = "fill_completed_normal.php"; fn.target = "fraFillHidden"; break; case(0):
 fn.action = "fill_proc.php"; fn.target = "_self"; break; }
}

function chk_cymoney(fn){
 var str_chk_cymoney = 0; var tot_cymoney = 0; var str_ChkValues = ""; var str_SelValues = ""; var obj = fn.ChkBox_Cymoney; var chk = fn.elements["chk_each"]; var sel = fn.elements["sel_each"]; var obj_num = 0; var chkbox_num = 0; var tmp_obj; for(i=0; i<fn.length; i++){
 if(fn.elements[i].name == "ChkBox_Cymoney"){obj_num++;}
 }
 var s_cymoney; var need_cymoney = 0; if(obj_num){
 for(i = 0; i<obj_num; i++){
 if(obj_num == 1){
 tmp_obj = obj; tmp_chk = chk; tmp_sel = sel; }
 else{
 tmp_obj = obj[i]; tmp_chk = chk[i]; tmp_sel = sel[i]; }
 if(tmp_obj.checked == true){
 if(tmp_obj.value.match("coupon_") == "coupon_"){
 tot_cymoney = tot_cymoney + 0; }else{
 tot_cymoney = tot_cymoney + eval(tmp_obj.value); }
 if(str_ChkValues == ""){
 str_ChkValues = str_ChkValues + tmp_chk.value; }else{
 str_ChkValues = str_ChkValues + "," + tmp_chk.value; }

 if(str_SelValues == ""){
 str_SelValues = str_SelValues + tmp_sel.value; }else{
 str_SelValues = str_SelValues + "," + tmp_sel.value; }
 }
 }
 fn.ChkValues.value = str_ChkValues; fn.SelValues.value = str_SelValues; if(my_cymoney < tot_cymoney){
 str_chk_cymoney = 1; }
 }
 if(str_chk_cymoney == 1){
 need_cymoney = tot_cymoney - my_cymoney;
 
 if(document.getElementById("short_cymoney")){
 s_cymoney = document.getElementById("short_cymoney"); s_cymoney.innerHTML = int_Comma(""+need_cymoney+""); }
 if(document.getElementById("CyMoney_total")){
 document.getElementById("CyMoney_total").innerText=tot_cymoney; }
 if(document.getElementById("item_buy_span")){
 document.getElementById("item_buy_span").innerHTML = document.getElementById("div_fill_cymoney").innerHTML; }
 }
 else{
 need_cymoney = 0; s_cymoney = document.getElementById("short_cymoney"); if(s_cymoney){
 s_cymoney.innerHTML = int_Comma(""+need_cymoney+""); if(document.getElementById("CyMoney_total")){
 document.getElementById("CyMoney_total").innerText=tot_cymoney; }
 if(document.getElementById("item_buy_span")){
 document.getElementById("item_buy_span").innerHTML = document.getElementById("div_item_buy").innerHTML; }
 }
 }
}

function chk_fill(fn){
 if(!fn.fill_password.value){
 alert(str_msg_password_input); fn.fill_password.focus(); return(false); }
}

function chk_login(){
 
 alert(decodeURIComponent("%E8%AF%B7%E5%85%88%E7%99%BB%E5%BD%95"));}


function buy_theme(itemid){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 WinOpen("/mall/theme_buy.php?itemid="+itemid,"Theme_buy","480","550","yes");}

function gift_theme(itemid){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 var strUrl; strUrl = "/mall/theme_gift.php?itemid="+itemid; 
 if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinOpen(strUrl,"Theme_gift","480","550","yes");}

function appeal_theme(itemid){
 WinOpen("/mall/theme_appeal.php?itemid="+itemid,"Theme_appeal","480","550","yes");}

function check_search(fn){
 if(trim(fn.search_keyword.value)==""){
 
 alert(decodeURIComponent("%E8%AF%B7%E8%BE%93%E5%85%A5%E6%90%9C%E7%B4%A2%E5%85%B3%E9%94%AE%E5%AD%97")); return false; }
 return true;}


function buyIconPreview(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 WinOpen("/mall/personacon_buy.php?ChkValues="+intItemid,"item_buy","400","300");}

function buyMessageCard(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 WinOpen("/mall/message_card_buy.php?itemid="+intItemid,"item_buy","430","400");}

function buyNotepaper(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 strUrl = "/mall/notepaper_buy.php?itemid="+intItemid; WinWidth = 480; WinHeight = 550; ScrollBar = "no"; strName = "item_buy"; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,WinWidth,WinHeight,"yes","yes",WinGubun,strProperty); 
}


function buyDIY(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 strUrl = "/mall/skin_diy_buy.php?itemid="+intItemid; WinWidth = 975; WinHeight = 780; ScrollBar = "no"; strName = "diy_buy"; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,WinWidth,WinHeight,"yes","yes",WinGubun,strProperty); 
}

function giftDIY(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 strUrl = "/mall/skin_diy_gift.php?itemid="+intItemid; if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinWidth = 940; WinHeight = 780; ScrollBar = "no"; strName = "diy_buy"; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,WinWidth,WinHeight,"yes","yes",WinGubun,strProperty); 
}


function buyMinime(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 strUrl = "/mall/minime_buy.php?itemid="+intItemid; ScrollBar = "no"; strName = "diy_buy"; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,500,610,"no","no",WinGubun,strProperty); 
}


function giftMinime(intItemid){
 
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 strUrl = "/mall/minime_gift.php?itemid="+intItemid; if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinWidth = 335; WinHeight = 650; ScrollBar = "no"; strName = "diy_gift"; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,WinWidth,WinHeight,"yes","yes",WinGubun,strProperty); 
}


function giftIconPreview(intItemid){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 var strUrl; strUrl = "/mall/personacon_gift.php?ChkValues="+intItemid; 
 if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinOpen(strUrl,"item_buy","400","400");}

function giftMessageCard(intItemid){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 var strUrl; strUrl = "/mall/message_card_gift.php?itemid="+intItemid; 
 if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinOpen(strUrl,"item_buy","400","560");}

function giftNotepaper(intItemid){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 var strUrl; strUrl = "/mall/notepaper_gift.php?itemid="+intItemid; 
 if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinWidth = 480; WinHeight = 700; ScrollBar = "no"; strName = ""; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,WinWidth,WinHeight,"yes","yes",WinGubun,strProperty);}

function buy_item(itemid,cymoney){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 WinOpen("/mall/item_buy.php?itemid="+itemid+"&cymoney="+cymoney,"miniroom_item","388","290","no");}

function free_use(itemid,cymoney){
 if(chk_broswer()==true){
 try{
 saveItemInfo(itemid); }catch(e){}
 }
 WinOpen("/mall/free_use.php?itemid="+itemid+"&cymoney="+cymoney,"Theme_buy","388","290","no");}

function memberServiceInform(){
 parent.document.location.replace("/mall/member_guide_list.php");}
function gift_item(itemid,cymoney,item_type){
 var strUrl; if(item_type){
 strUrl = "/mall/gift.php?itemid="+itemid+"&cymoney="+cymoney; }else{
 strUrl = "/mall/gift.php?itemid="+itemid+"&cymoney="+cymoney; }
 
 if(parent.frmHidden){
 recive_id = parent.frmHidden.document.getElementById("recive_id").value; recive_name = parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }else if(top.parent.frmHidden){
 recive_id = top.parent.frmHidden.document.getElementById("recive_id").value; recive_name = top.parent.frmHidden.document.getElementById("recive_name").value; strUrl = strUrl + "&recive_id=" + recive_id + "&recive_name=" + recive_name; }
 WinOpen(strUrl,"Theme_buy","388","450","no");}


function WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty){
 var x=screen.width/2 - WinWidth/2; var y=screen.height/2 - WinHeight/2; var OpBrWin;
 if (WinGubun == "" || WinGubun == "Normal"){
 OpBrWin = window.open(''+strUrl+'',''+strName+'','scrollbars='+ScrollBar+',resizable='+Resize+',width='+WinWidth+',height='+WinHeight+','+strProperty+''); }
 else{
 OpBrWin = window.open(''+strUrl+'',''+strName+'','left='+x+', top='+y+', width='+WinWidth+', height='+WinHeight+',scrollbars='+ScrollBar+',resizable='+Resize+','+strProperty+''); }

 if(OpBrWin){
 OpBrWin.focus(); }
 return(OpBrWin);}


function inputCheckCommon(element,maxLength,filter){
 var temp; var charcount; var reserve; var currentLenght = 0; var inputLength = element.value.length; if(filter=='B'||filter=='T'||filter=='U'){
 if (wordFilter(element.value,filter)){
 return false; }
 }
 for(k=0; k<inputLength; k++){
 temp = element.value.charAt(k); if(escape(temp).length > 4){
 currentLenght += 2; }else{
 currentLenght++; }
 }
 if(currentLenght > maxLength){
 element.value = cutInputStr(element.value,maxLength); 
 alert(decodeURIComponent("%E6%9C%80%E5%A4%9A") + maxLength + decodeURIComponent("%E4%B8%AA%E5%AD%97%E7%AC%A6")); }
 if(currentLenght>maxLength)currentLenght = maxLength; if(document.getElementById(element.id + '_count'))document.getElementById(element.id + '_count').innerHTML = '(' + currentLenght + '/'+maxLength+')';}


function cutInputStr(aquery,i){
 var tmpStr; var temp=0; var onechar; var tcount;
 tcount = 0; tmpStr = new String(aquery); temp = tmpStr.length;
 for(k=0;k<temp;k++){
 onechar = tmpStr.charAt(k); if(escape(onechar).length > 4){ tcount += 2; }
 else if(onechar!="\r\n"){ tcount++; }
 if(tcount>i){
 tmpStr = tmpStr.substring(0,k); break; }
 }
 return tmpStr;}

function winResize_MoveCenter(size_x,size_y){
 var x=screen.width/2 - size_x/2; var y=screen.height/2 - size_y/2; window.resizeTo(size_x,size_y); window.moveTo(x,y);}

function ChkStateCheck(){
 var ChkObj = document.all["ChkBox"]; if(ChkObj){
 var ChkBoxCnt = ChkObj.length; if(ChkBoxCnt) {
 for(var i=0; i < ChkBoxCnt; i++) { if(ChkObj[i].checked == true) { return true; } }
 }
 else{
 if(ChkObj.checked == true) { return true; }
 else{return false;}
 }
 }
}

function ChkSelValues(fn){
 var ChkValues = ""; var ChkObj = document.all["ChkBox"]; var ChkBoxCnt = ChkObj.length; var ChkNum = 0;
 if(!ChkBoxCnt) { if(ChkObj.checked == true) { ChkValues = ChkObj.value ; } }
 else { for(var i = 0; i < ChkBoxCnt; i++) { if(ChkObj[i].checked == true) { if(ChkNum == 0) { ChkValues += ChkObj[i].value ; ChkNum = 1; } else { ChkValues += "," + ChkObj[i].value; } } } }

 fn.ChkValues.value = ChkValues;
 if (ChkValues == "") { return false; } else { return true; }
}

function MallImageResize(objId) {

 myImage = new Image();
 myImage.src = document.getElementById(objId).src;
 var height = myImage.height; var width = myImage.width; var objwidth=0; var objheight=0; if(myImage.height > 80) {
 objheight = 80; objwidth = (width*80)/height; if(objwidth>80){
 objwidth = 80; objheight = (height*80)/width; }
 document.getElementById(objId).style.height = objheight; document.getElementById(objId).style.width = objwidth; }else if(myImage.width > 80) {
 objwidth = 80; objheight = (height*80)/width; if(objheight>80){
 objheight = 80; objwidth = (height*80)/width; }
 document.getElementById(objId).style.height = objheight; document.getElementById(objId).style.width = objwidth; }
}

function MallThemeImageResize(objId) {

 myImage = new Image(); myImage.src = document.getElementById(objId).src;
 var height = myImage.height; var width = myImage.width; var objwidth=0; var objheight=0; if(myImage.height > 90) {
 objheight = 90; objwidth = (width*90)/height; if(objwidth>90){
 objwidth = 90; objheight = (height*90)/width; }
 document.getElementById(objId).style.height = objheight; document.getElementById(objId).style.width = objwidth; }else if(myImage.width > 90) {
 objwidth = 90; objheight = (height*90)/width; if(objheight>90){
 objheight = 90; objwidth = (height*90)/width; }
 document.getElementById(objId).style.height = objheight; document.getElementById(objId).style.width = objwidth; }
}


function Trim(strObj){
 if(strObj){
 return strObj.replace(/^\s+|\s+$/g,""); }
}


function collection(itemid, cymoney){
 var xmlhttp = new XmlHttp(); var sUrl = "/services/mall/collection_proc.php?itemid="+itemid+"&cymoney="+cymoney; xmlhttp.response(sUrl,"","collectionMessage");}

function collectionMessage(obj) {
 var result = obj.responseText; if (result=="0"){
 
 alert(decodeURIComponent("%E8%AF%B7%E7%99%BB%E5%BD%95%E5%90%8E%E5%86%8D%E6%93%8D%E4%BD%9C")); var login=document.getElementById("login-input-email"); if(login){
 login.focus(); }
 }
 else if (result=="1"){
 
 
 alert(decodeURIComponent("%E5%B7%B2%E7%BB%8F%E6%88%90%E5%8A%9F%E6%94%BE%E5%85%A5%E6%84%BF%E6%9C%9B%E7%AE%B1%EF%BC%81")); }
 else if (result=="2"){
 
 alert(decodeURIComponent("%E6%84%BF%E6%9C%9B%E7%AE%B1%E4%B8%AD%E5%B7%B2%E6%9C%89%E6%AD%A4%E5%95%86%E5%93%81")); }
 else {
 alert(str_msg_request_aborted); }
}


function itemPreview(ObjId, var_name, login_chk, mh_id){
 
 if(login_chk){
 view_f_name = "/ps2/common/preview_home.php"; }else{
 view_f_name = "/ps2/common/preview_anonymous.php"; }
 var checkItem = document.getElementById(ObjId); if(var_name == "a_item_font"){
 var fontOnly = document.getElementById('fontOnly'); }

 if(checkItem.tagName == "A"){
 arrItem = ObjId.split('_'); intItemid = arrItem[1]; chk_query = "&" + var_name + "=" + intItemid; if(preview_query != ''){
 preview_query = preview_query.replace(var_name,"needToReplace"); preview_query = preview_query.replace(/&needToReplace=\d*/i,""); }
 preview_query = preview_query + chk_query; preview_url = view_f_name+"?mh_id="+mh_id+preview_query
 document.getElementById("iframeItemview").src = preview_url; }
 else{

 chk_query = "&" + var_name + "=" + checkItem.value; if(checkItem.checked == true){
 
 preview_query = preview_query.replace(var_name,"needToReplace"); preview_query = preview_query.replace(/&needToReplace=\d*/i,""); preview_query = preview_query + chk_query; if(fontOnly){
 fontOnly.style.display = "block"; }
 }else{
 preview_query = preview_query.replace(chk_query,""); if(fontOnly){
 fontOnly.style.display = "none"; }
 }
 preview_url = view_f_name+"?mh_id="+mh_id+preview_query; document.getElementById("iframeItemview").src = preview_url; }

}

function buyMHitem(type){
 var msg = ""; var xmlhttp = new XmlHttp(); var ChkValues = ""; var SelValues = ""; var sUrl,callBackFunction; var postXml = ""; var method = ""; var mimeType = ""; var recive_info = ""; var send_comment = ""; fn = document.frmItemBuy;
 
 ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; if(fn.extend_info){
 var extendInfo = fn.extend_info.value; }
 if((!ChkValues || !SelValues)){
 alert(str_msg_select_items); return false; }
 switch(eval(type)){
 case(0):
 callBackFunction = "itemBuyCallback"; sUrl = "/services/mall/item_buy_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&extend_info="+extendInfo; break; case(1):
 callBackFunction = "itemGiftCallback"; recive_info = document.getElementById('recive_info').value; send_comment = document.getElementById('send_comment').value; if(recive_info == ""){
 alert(str_msg_select_friend); return false; }
 
 
 
 
 
 postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/gift_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues; break; case(2):
 callBackFunction = "itemAppealCallback"; recive_info = document.getElementById('appeal_info').value; send_comment = document.getElementById('appeal_comment').value; if(recive_info == ""){
 alert(str_msg_select_friend); return false; }
 
 
 
 
 postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/appeal_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues; break; case(4):
 callBackFunction = "collectionMessage"; sUrl = "/mall/favorite_collection.php?ChkValues="+ChkValues+"&SelValues="+SelValues; break; }
 if(type != 4 && window.event && window.event.srcElement){
 window.event.srcElement.onclick = new Function("return false;"); window.event.srcElement.style.cursor = "default"; }
 xmlhttp.response(sUrl,postXml,callBackFunction,method,mimeType);}


function buyMRItem(type){
 var msg = ""; var xmlhttp = new XmlHttp(); var ChkValues = ""; var SelValues = ""; var sUrl,callBackFunction; var postXml = ""; var method = ""; var mimeType = ""; var recive_info = ""; var send_comment = ""; switch(eval(type)){
 case(0):
 fn = document.frmItemBuy; ChkValues = fn.ChkValues.value; if(fn.SelValues){
 SelValues = fn.SelValues.value; }
 item_type = fn.item_type.value;
 callBackFunction = "itemBuyCallback"; sUrl = "/services/mall/item_buy_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; case(1):
 fn = document.frmGift; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; item_type = fn.item_type.value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return; }
 callBackFunction = "itemGiftCallback"; send_comment = document.getElementById('send_comment').value; postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/gift_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; case(2):
 fn = document.frmGift; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return false; }
 item_type = fn.item_type.value; callBackFunction = "itemAppealCallback"; send_comment = document.getElementById('send_comment').value; postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/appeal_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; }
 if(window.event && window.event.srcElement){
 window.event.srcElement.onclick = new Function("return false;"); window.event.srcElement.style.cursor = "default"; }
 xmlhttp.response(sUrl,postXml,callBackFunction,method,mimeType);}



function buyIconItem(type){
 var msg = ""; var xmlhttp = new XmlHttp(); var ChkValues = ""; var SelValues = ""; var sUrl,callBackFunction; var postXml = ""; var method = ""; var mimeType = ""; var recive_info = ""; var send_comment = ""; fn = document.frmIconBuy; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; item_type = fn.item_type.value;
 switch(eval(type)){
 case(0):
 callBackFunction = "itemBuyCallback"; sUrl = "/services/mall/item_buy_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; case(1):
 callBackFunction = "itemGiftCallback"; send_comment = document.getElementById('send_comment').value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return; }
 if(send_comment == ""){
 alert(str_msg_input_message); return; }
 postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/gift_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; }
 if(window.event && window.event.srcElement){
 window.event.srcElement.onclick = new Function("return false;"); window.event.srcElement.style.cursor = "default"; }
 xmlhttp.response(sUrl,postXml,callBackFunction,method,mimeType);}

function appealPop(fn){
 if(!fn ){
 var fn = document.frmItemBuy; }
 var ChkValues = fn.ChkValues.value; var SelValues = fn.SelValues.value; if(SelValues.match("coupon_") == "coupon_"){
 alert('礼卷购买物品不能请求朋友付账'); }else{
 WinOpen("/mall/personacon_appeal.php?ChkValues="+ChkValues+"&SelValues="+SelValues,"Theme_appeal","480","450","yes"); window.close(); }
}


function itemBuyCallback(obj){
 var str = obj.responseText; var arr_str = str.split(","); var cymoney = arr_str[1]; var result = Trim(arr_str[0]); switch (result) {
 
 case (str_not_login):
 alert(str_login_msg); break; case (str_succeed):
 if(cymoney){
 alert(str_msg_buy_succeed+"\n您共消费："+cymoney+"红豆!"); }else{
 alert(str_msg_buy_succeed); }
 break; case (str_used_coupon):
 alert(str_msg_used_coupon); break; case (str_coupon_already_used):
 alert(str_msg_coupon_already_used)
 break; case (str_spent_cymoney):
 alert(str_msg_cymoney_spent); break
 
 default:
 alert(str_msg_request_aborted); }
 window.close();}

function eventDiscountCallBack(opusid,strCallBackinfo,cymoney) {
 $.ajax({
 type: "post",
 url: "/event/2009/vision/seller.php",
 data: "opusid="+opusid+"&info="+strCallBackinfo,
 dataType: "json",
 success: function(json) {}
 }); if(cymoney){
 alert(str_msg_buy_succeed+"\n您共消费："+cymoney+"红豆!"); }else{
 alert(str_msg_buy_succeed); }
}


function itemGiftCallback(obj){
 var result = Trim(obj.responseText); switch (result) {
 case (str_not_login):
 alert(str_login_msg); break; case (str_succeed):
 alert(str_msg_gift_succeed); break; case (str_used_coupon):
 alert(str_msg_gift_used_coupon); break; case (str_coupon_already_used):
 alert(str_msg_coupon_already_used)
 break; case (str_the_user_is_inactive):
 alert(str_msg_user_is_inactive); break; case (str_the_user_is_leave):
 alert(str_msg_user_is_leave); break; case (str_no_this_user):
 alert(str_msg_no_this_user); break; case (str_spent_cymoney):
 alert(str_msg_cymoney_spent); break; case (str_found_deny_words):
 alert(FOUND_DENY_WORDS); break; case (str_stop_cymoney_present):
 alert(str_msg_stop_cymoney_present); break; default:
 alert(str_msg_request_aborted); }
 window.close();}


function itemAppealCallback(obj){
 var result = Trim(obj.responseText); switch (result) {
 case (str_not_login):
 alert(str_login_msg); break; case (str_succeed):
 alert(str_msg_appeal_succeed); break; case (str_the_user_is_leave):
 alert(str_msg_user_is_leave); break; case (str_found_deny_words):
 alert(FOUND_DENY_WORDS); break; case ('11'):
 alert("未到抢购时间或者时间已过!"); break; case ('12'):
 alert("昨日您的小窝中赛我会员留言量未超过10条!"); break; default:
 alert(str_msg_request_aborted); }
 window.close();}


function search_friend(){
 strUrl = "/main/buddy/pop_buddy_search.php?mode=none"; strName = "WinSearchBuddy"; WinWidth = 388; WinHeight = 355; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; item_win = WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty);}

function viewGift(myItemId){
 if(document.getElementById('myitem_id')){
 document.getElementById('myitem_id').value = myItemId; }
 strUrl = "/mall/gift_accept.php?myitem_id=" + myItemId; strName = "GiftAcceptlWindow"; WinWidth = 388; WinHeight = 420; ScrollBar = "no"; Resize = "no"; WinGubun = "Center"; strProperty = ""; WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty);}


function chkCymoney(fn){
 
 var total_money = 0; var length = 1; var str_ChkValues = ""; var str_SelValues = ""; var chks = fn.elements["chk[]"]; var sels = fn.elements["sel[]"]; var ChkBoxs = fn.elements["ChkBox[]"]; 
 
 if(!ChkBoxs){
 alert(str_msg_select_items); return false; }
 
 if(ChkBoxs.length){

 length = ChkBoxs.length; }
 str_ChkValues = ''; str_SelValues = ''; for(var i = 0; i < length; i++){
 if(length != 1){
 chk = chks[i]; sel = sels[i]; ChkBox = ChkBoxs[i]; }else{
 chk = chks; sel = sels; ChkBox = ChkBoxs; }
 if(ChkBox.checked){
 total_money += eval(ChkBox.value); if(str_ChkValues == ""){
 str_ChkValues = str_ChkValues + chk.value; }else{
 str_ChkValues = str_ChkValues + "," + chk.value; }
 if(str_SelValues == ""){
 str_SelValues = str_SelValues + sel.value; }else{
 str_SelValues = str_SelValues + "," + sel.value; }
 }
 }

 fn.ChkValues.value = str_ChkValues; fn.SelValues.value = str_SelValues; 
 if(document.getElementById("CyMoney_total")){
 document.getElementById("CyMoney_total").innerHTML=total_money+"红豆"; }

 
 var remainCymoney = document.getElementById("remainCymoney"); if(my_cymoney < total_money){
 if(remainCymoney){
 remainCymoney.innerHTML = "0"; }
 if(document.getElementById("cymoneyInfo")){
 document.getElementById("cymoneyInfo").style.display = "block"; }
 var need_money = total_money - my_cymoney; if(document.getElementById("short_cymoney")){
 document.getElementById("short_cymoney").innerHTML=need_money+"红豆"; }
 
 if(document.getElementById("payDiv")){
 document.getElementById("payDiv").style.display=""; }
 if(document.getElementById("buyDiv")){
 document.getElementById("buyDiv").style.display="none"; }
 }else{
 var remain_cymoney
 remain_cymoney = my_cymoney - total_money; if(remainCymoney){
 remainCymoney.innerHTML = remain_cymoney+"红豆"; }
 if(document.getElementById("cymoneyInfo")){
 document.getElementById("cymoneyInfo").style.display = "none"; }
 if(document.getElementById("payDiv")){
 document.getElementById("payDiv").style.display="none"; }
 if(document.getElementById("buyDiv")){
 document.getElementById("buyDiv").style.display=""; }
 }
 return true;}


function saveItemInfo(itemid,name){
 
 var viewItem = document.getElementById("viewItem"); var arr_itemid; var str_itemid = ""; var n = 0; 
 if(name =="MH"){
 viewItem.load("itemMHInfo"); }else{
 viewItem.load("itemInfo"); }
 var pre_itemid = viewItem.getAttribute("itemid"); if(pre_itemid){
 arr_itemid = pre_itemid.split(","); 
 for(var i = 0; i < arr_itemid.length; i++){
 if(itemid == arr_itemid[i]){
 continue; }else{
 if(str_itemid != ""){
 str_itemid = str_itemid + "," +arr_itemid[i]; }else{
 str_itemid = arr_itemid[i]; }
 n++; }
 if(n >=5)break; }
 if(str_itemid != ""){
 itemid = itemid + "," +str_itemid; }
 }
 viewItem.setAttribute("itemid",itemid);
 if(name =="MH"){
 viewItem.save("itemMHInfo"); }else{
 viewItem.save("itemInfo"); }
}

function chk_broswer(){
 if (navigator.appName.indexOf("Microsoft")!=-1) {
 return(true); }
 else{
 return(false); }
}


function buyCapability(type){
 var msg = ""; var xmlhttp = new XmlHttp(); var ChkValues = ""; var SelValues = ""; var sUrl,callBackFunction; var postXml = ""; var method = ""; var mimeType = ""; var recive_info = ""; var send_comment = "";
 switch(eval(type)){
 case(0):
 fn = document.frmCapabilityBuy; itemid = fn.itemid.value; cymoney = fn.cymoney.value; item_type = fn.item_type.value; callBackFunction = "itemBuyCallback"; sUrl = "/services/mall/capability_buy_proc.php?itemid="+itemid+"&cymoney="+cymoney+"&item_type="+item_type; break; case(1):
 fn = document.frmGift; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; item_type = fn.item_type.value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return; }
 callBackFunction = "itemGiftCallback"; send_comment = document.getElementById('send_comment').value; postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/gift_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; case(2):
 fn = document.frmGift; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return false; }
 item_type = fn.item_type.value; callBackFunction = "itemAppealCallback"; send_comment = document.getElementById('send_comment').value; postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/appeal_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type; break; }
 if(window.event && window.event.srcElement){
 window.event.srcElement.onclick = new Function("return false;"); window.event.srcElement.style.cursor = "default"; }
 xmlhttp.response(sUrl,postXml,callBackFunction,method,mimeType);}

function groupItemPreview(var_name, login_chk, mh_id){
 if(login_chk){
 view_f_name = "/ps2/common/preview_home.php"; }else{
 view_f_name = "/ps2/common/preview_anonymous.php"; }
 preview_query = preview_query + var_name; preview_url = view_f_name+"?mh_id="+mh_id+preview_query; document.getElementById("iframeItemview").src = preview_url;}
function applyShowMinihompy(cyid,type){
 if(win_sign){
 if(!win_sign.closed){
 win_sign.close(); }
 }
 if(type){
 var win_sign = WinOpen('/mall/show_sign_up.php?cyid='+cyid+'&style_type='+type,"Theme_buy","930","668",""); }else{
 var win_sign = WinOpen('/mall/show_sign_up.php?cyid='+cyid,"Theme_buy","930","668",""); }

}

function goToScore(mh_id,showid,style_type){
 if(win_score){
 if(!win_score.closed){
 win_score.close(); }
 }
 var win_score = WinOpen('/mall/show_mark.php?mh_id='+mh_id+'&showid='+showid+'&style_type='+style_type,"Theme_buy","932","668","");}

function jump(href){
 document.location.replace(href);}


function getPresentCymoney(cymoney,payChannel){
 switch(payChannel){
 case "bank":
 if(cymoney>=20 && cymoney < 50){
 var presentCymoney = cymoney*11; }else if(cymoney >= 50){
 var presentCymoney = cymoney*12; }else{
 var presentCymoney = cymoney*10; }
 break; default:
 var presentCymoney = cymoney*10; break; }
 return Math.round(presentCymoney);}
function hideDiv(name){
 $("div[name='"+name+"']").css("display","none");}


function previewPs(itemid){
 var formNode = document.createElement("form"); var inputNode = document.createElement("input"); formNode.setAttribute("name","previewPs"); formNode.setAttribute("id","previewPs"); formNode.setAttribute("method","post"); formNode.setAttribute("target","previewPsWindow"); inputNode.setAttribute("type","hidden"); inputNode.setAttribute("name","itemid"); inputNode.setAttribute("id","itemid"); formNode.appendChild(inputNode); document.body.appendChild(formNode); var fn = document.getElementById('previewPs'); strUrl = "about:blank"; frmAction = "/mall/ps_preview.php"; strName = "previewPsWindow"; WinWidth = 932; WinHeight = 542; ScrollBar = 0; Resize = "no"; WinGubun = ""; strProperty = "toolbar=yes,menubar=yes,scrollbars=yes"; ps_win = WinOpen(strUrl,strName,WinWidth,WinHeight,ScrollBar,Resize,WinGubun,strProperty); fn.action=frmAction; fn.itemid.value=itemid; 
 fn.submit();}

var hue = 0;function displayColorList(id){ 
 
 for(var i=0;i<11;i++){
 document.getElementById("color_"+i).style.display = "none"; if(i != hue){
 document.getElementById("inputbutton_"+i).className = "inputbutton"; }
 }
 document.getElementById("color_"+id).style.display = "block"; document.getElementById("inputbutton_"+id).className = "inputbutton focus";


 displayClew(id);}

function displayClew(id){
 if(id != hue){
 document.getElementById("color_span_"+id).style.display = "block"; }
}

function hideClew(id){
 if(id != hue){
 document.getElementById("color_span_"+id).style.display = "none"; }
}

function hideColorList(id){
 if(id != hue){
 document.getElementById("inputbutton_"+id).className = "inputbutton"; } 
 document.getElementById("color_"+id).style.display = "none"; hideClew(id);}

function buyMRItemEvent(type,from){
 var msg = ""; var xmlhttp = new XmlHttp(); var ChkValues = ""; var SelValues = ""; var sUrl,callBackFunction; var postXml = ""; var method = ""; var mimeType = ""; var recive_info = ""; var send_comment = ""; switch(eval(type)){
 case(0):
 fn = document.frmItemBuy; ChkValues = fn.ChkValues.value; if(fn.SelValues){
 SelValues = fn.SelValues.value; }
 item_type = fn.item_type.value;
 callBackFunction = "itemBuyCallback"; sUrl = "/services/mall/item_buy_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type+"&from="+from; break; case(1):
 fn = document.frmGift; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; item_type = fn.item_type.value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return; }
 callBackFunction = "itemGiftCallback"; send_comment = document.getElementById('send_comment').value; postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/gift_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type+"&from="+from; break; case(2):
 fn = document.frmGift; ChkValues = fn.ChkValues.value; SelValues = fn.SelValues.value; recive_info = document.getElementById('recive_info').value; if(recive_info == ""){
 alert(str_msg_select_friend); return false; }
 item_type = fn.item_type.value; callBackFunction = "itemAppealCallback"; send_comment = document.getElementById('send_comment').value; postXml = recive_info + "|&**&|" + send_comment; method = "POST"; mimeType = "application/x-www-form-urlencoded"; sUrl = "/services/mall/appeal_proc.php?ChkValues="+ChkValues+"&SelValues="+SelValues+"&item_type="+item_type+"&from="+from; break; }
 if(window.event && window.event.srcElement){
 window.event.srcElement.onclick = new Function("return false;"); window.event.srcElement.style.cursor = "default"; }
 xmlhttp.response(sUrl,postXml,callBackFunction,method,mimeType);}/* [2010-09-04 02:14:39] 0.0109648704529 */