
function validateMusic(url){fn=document.frmMusicitem;var isChecked=false;if(fn.ChkValues.checked==false&&fn.ChkValues.length==undefined){isChecked=false;}else if(fn.ChkValues.checked==true&&fn.ChkValues.length==undefined){isChecked=true;}else{for(i=0;i<fn.ChkValues.length;i++){if(fn.ChkValues[i].checked){isChecked=true;break;}}}
if(isChecked==false){document.frmSort.action=url;document.frmSort.submit();}else{displayConfirm(url);}}
function displayConfirm(url){var cfmbox=document.getElementById('confirmBox');var content='<p>'+str_msg_confirmation_box+'</p>';content=content+'<p>';content=content+'<span class="cfmButton"><a href="#" onclick="validateConfirm(1,\''+url+'\')">Continue</a></span>';content=content+'<span class="cfmButton"><a href="#" onclick="validateConfirm(2,\''+url+'\')">Checkout</a></span>';content=content+'<span class="cfmButton"><a href="#" onclick="validateConfirm(3,\''+url+'\')">Cancel</a></span>';content=content+'</p><p style="clear:both;"></p>';cfmbox.innerHTML=content;cfmbox.style.top="300px";}
function hideConfirm(){var cfmbox=document.getElementById('confirmBox');cfmbox.innerHTML="";cfmbox.style.top="-200px";}
function validateConfirm(v,url){switch(v){case 1:document.frmSort.action=url;document.frmSort.submit();break;case 2:music_chk(0);break;default:break;}
hideConfirm();return true;}
function music_chk(v){fn=document.frmMusicitem;fn2=document.frmItem_buy;var lstChkValues="";var lstSelValues="";if(fn.ChkValues.checked==false&&fn.ChkValues.length==undefined){return false;}else if(fn.ChkValues.checked==true&&fn.ChkValues.length==undefined){lstChkValues=fn.ChkValues.value;lstSelValues=fn.elements['SelValue0'].value;}else{for(i=0;i<fn.ChkValues.length;i++){if(fn.ChkValues[i].checked){lstChkValues=lstChkValues+','+fn.ChkValues[i].value;lstSelValues=lstSelValues+','+fn.elements['SelValue'+i].value;}}
if(lstSelValues.length>0){lstChkValues=lstChkValues.slice(1,lstChkValues.length);lstSelValues=lstSelValues.slice(1,lstSelValues.length);}}
if(lstSelValues.length==0){alert(str_msg_select_at_least_one);return;}
fn2.ChkValues.value=lstChkValues;fn2.SelValues.value=lstSelValues;music_purchase_noChk(v);}
function music_purchase_noChk(goWhere){var msg="";var bool_chk_coupon=false;var str_chk_coupon="";fn=document.frmItem_buy;fn_save=document.frmsave_chk;var chk_ChkBox_num=0;var temp;var ChkValues="";var SelValues="";var ChkNum=0;switch(eval(goWhere)){case(0):if(fn_save.save_chk.checked==true){fn.save_chk.value=1;}
fn.action="/mall/item_purchase.php";fn.submit();return 1;break;case(1):fn.action="/mall/item_send_gift.php";fn.submit();return 1;break;break;case(2):fn.action="/mall/item_ask_gift.php";fn.submit();return 1;break;if(chk_broswer()==true){fn.action="/mall/appeal.php";}
else{fn.action="/mall/appeal_fire_fox.php";}
strUrl="about:blank";strName="itemBuyWindow";WinWidth=388;WinHeight=345;ScrollBar="no";Resize="no";WinGubun="Center";strProperty="";str_Selvalues_chk=fn.SelValues.value;str_chk_coupon=str_Selvalues_chk.match(/coupon_/i);msg=str_msg_appeal_cant_use_coupon;break;case(3):fn.action="/mall/item_wish_box.php";fn.submit();return 1;fn.action="/mall/wish_box.php";strUrl="about:blank";strName="itemBuyWindow";WinWidth=247;WinHeight=140;ScrollBar="no";Resize="no";WinGubun="Center";strProperty="";str_Selvalues_chk=fn.SelValues.value;str_chk_coupon=str_Selvalues_chk.match(/coupon_/i);msg=str_msg_wishbox_cant_use_coupon;break;}
return 0;}
function sort(midcat,v){fn2=document.frmSortSetting;song=fn2.song.value;artist=fn2.artist.value;album=fn2.album.value;switch(v){case 1:if(song==""){song="desc";}else if(song=="desc"){song="asc";}else if(song=="asc"){song="desc";}
break;case 2:if(artist==""){artist="desc";}else if(artist=="desc"){artist="asc";}else if(artist=="asc"){artist="desc";}
break;case 3:if(album==""){album="desc";}else if(album=="desc"){album="asc";}else if(album=="asc"){album="desc";}
break;}
fn=document.frmSort;var sortCriteria="&song="+song+"&artist="+artist+"&album="+album;var viewCount="&view_cnt="+fn.view_cnt[fn.view_cnt.selectedIndex].value;fn.action="/mall/item_list_s_music.php?middleMenu="+midcat+sortCriteria+viewCount;fn.submit();}
function sortMusicType(s,m,v){var dr=document.getElementById('date_range');var date_range="&date_range="+dr.options[dr.selectedIndex].value;var viewCount="";fn=document.frmSort;try{var viewCount="&view_cnt="+fn.view_cnt[fn.view_cnt.selectedIndex].value;}catch(e){}
fn.action="/mall/item_list_s_music_list.php?middleMenu="+m+"&sort="+s+"&view="+v+viewCount+date_range;fn.submit();}