/* Global */
var urlComposer = new UrlComposer();

function navFolder(folderId){
    urlComposer.makeAndGo({folder: folderId}, 'folder.htm', true, ['id']);
}
function navFolder2(folderId,page){
    urlComposer.makeAndGo({folder: folderId, page: page}, 'folder.htm', true, ['id']);
}
function navAllSub(){
    urlComposer.makeAndGo({folder: 0, tag: 0}, 'subscription.htm', true, ['id']);
}


function navSubFolder(folderId){
    urlComposer.makeAndGo({folder: folderId}, 'subscription.htm', true, ['id']);
}

function navSubTag(tagId){
    urlComposer.makeAndGo({tag: tagId}, 'subscription.htm', true, ['id']);
}
function navSubIvy(ivyId){
	urlComposer.makeAndGo({ivy: ivyId}, 'subscription.htm', true, ['id']);
}

function navOrder(orderId){
    urlComposer.makeAndGo({order: orderId});
}

function navEncoding(){
	urlComposer.makeAndGo({}, "encoding.htm", true, ['id']);
}

function navFilter(filterId){
    urlComposer.makeAndGo({filter: filterId});
}

function subscribeFolder(station, folder){
	window.open('/mystation/popupSub.htm?decorator=popup&confirm=true&id='+station+'&fid='+folder+'','','width=525,height=355');
}

function toggleOwnCommentFilter(){
    var f = document.forms['commentFilterForm'];
    var cval = f['own'].value;
    var nval = 1;
    if(cval != null && cval == 1)
        nval = 0;

    f['own'].value = nval;
    f.submit();
}

function deleteVideo(station, video){
    winOpen('/mystation/popupDelete.htm?decorator=popup&confirm=true&id='+station+'&vid='+video+'', '', 10, 10);
}
function deletePhoto(station, photo, type){
    winOpen('/mypage/popup_photo_delete.jsp?id='+station+'&type='+type+'&ids='+photo+'', '', 10, 10);
}
function deleteGame(station, game, type){
    winOpen('/mypage/popup_game_delete.jsp?id='+station+'&type='+type+'&ids='+game+'', '', 10, 10);
}

function editPhoto(station, video){
  winOpen('http://photo.mgoon.com/upload/modify.htm?pt_id='+video, '', 970, 768);
}

function editVideo(station, video){
    winOpen('/mystation/popupEdit.htm?decorator=popup&confirm=true&id='+station+'&vid='+video+'', '', 10, 10);
}

function stat(video){
    winOpen('/viewutil/playstat.htm?video='+video, '', 430, 400);
}

function deleteComment(station, commentId){
    window.open('/mystation/deleteComment.htm?decorator=popup&confirm=true&id='+station+'&cid='+commentId+'','','width=600,height=500');
}

function deleteRely(station, commentId){
    location.href='/mystation/deleteReply.htm?decorator=popup&confirm=true&id='+station+'&reply_id='+commentId;
}

function addVideoToMain(station, video){
	window.open('/mystation/popup_add_main.jsp?&station='+station+'&video='+video+'','','width=10,height=10');
}

function delVideoMain(station, video){
	window.open('/mystation/popup_del_main.jsp?&station='+station+'&video='+video+'','','width=10,height=10');
}

