function createLinks(){
    linkWin = window.open('../edit_links.php', "linkWin", "width=1150,height=1050,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    imgWin.focus();
}
function editLink(id){
    elinkWin = window.open('edit_link.php?id='+id, "elinkWin", "width=1150,height=1050,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    imgWin.focus();
}

function showImg(id, table, column) {
    imgWin = window.open('../img_item.php?id='+id+'&table='+table+'&col='+column, "showWin", "width=1150,height=1050,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    imgWin.focus();
}
function editImg(id, table, column) {
    imgWin = window.open('../edit_item.php?id='+id+'&table='+table+'&col='+column, "editWin", "width=1140,height=900,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    imgWin.focus();
}
function showUploadImg(type) {
    uploadWin = window.open('../image_upload.php?itemtype='+type, "showUp", "width=1300,height=770,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    uploadWin.focus();
}

function editCard(id,table,column){
    cardWin = window.open('../edit_card.php?id='+id+'&table='+table+'&col='+column, "editCard", "width=1140,height=800,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    cardWin.focus();
}
function showCard(id,table,column){
    cardWin = window.open('../greet_load.php?g_id='+id+'&table='+table+'&col='+column, "showCard", "width=1130,height=750,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    cardWin.focus();
}
function linkBookmark(id) {
    linkWin = window.open('link_book.php?greet_id='+id, "newLinkWin", "width=1130,height=650,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    linkWin.focus();
}

function editBook(id,table,column){
    bookWin = window.open('../edit_book.php?id='+id+'&table='+table+'&col='+column, "editBook", "width=1140,height=800,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    bookWin.focus();
}
function showBook(id,table,column) {
    bookWin = window.open('../book_load.php?b_id='+id+'&table='+table+'&col='+column, "showBook", "width=1140,height=800,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    bookWin.focus();
}

function showWearable(w_id) {
    wearWin = window.open('../wearable_load.php?w_id='+w_id, "showWear", "width=565,height=650,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    wearWin.focus();
}
function editWearable(w_id){
    wearWin = window.open('../wearable_load.php?w_id='+w_id+'&edit=yes', "editWear", "width=565,height=850,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    wearWin.focus();
}
function wearableUpload() {
    wearWin = window.open('../wearable_upload.php', "wearUp", "width=1300,height=770,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    wearWin.focus();
}

function showOrn(o_id){
    ornWin = window.open('../ornament_load.php?o_id='+o_id+'&edit=no', "showOrn", "width=565,height=850,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    ornWin.focus();
}
function editOrn(o_id){
    ornWin = window.open('../ornament_load.php?o_id='+o_id+'&edit=yes', "editOrn", "width=565,height=600,scrollbars=yes,resizable=yes,toolbar=no,location=no");
    ornWin.focus();
}

function openEdit(id, col, size, type, path){
	winSize=parseInt(size)+50;
	eidtWin = window.open(path+'edit_page.php?id='+id+'&col='+col+'&type='+type+'&size='+size,'editWin2','left=20,top=20,width='+winSize+',height=600,toolbar=0,scrollbars=yes, location=0,resizable=yes');
    editWin.focus();
}
function openSandEdit(id, col, size, type, path){
	winSize=parseInt(size)+50;
	eidtWin = window.open(path+'sand_edit_page.php?id='+id+'&col='+col+'&type='+type+'&size='+size,'editWin3','left=20,top=20,width='+winSize+',height=800,toolbar=0,location=0,resizable=1');
    editWin.focus();
}


function chkin(path){
	chkinWin = window.open(path+'chkin.php','chkinWin','left=20,top=20,width=1460,height=330,toolbar=0,location=0,resizable=0');
}
function manage(path){
	manageWin = window.open(path+'manage.php','manageWin','left=20,top=20,width=1260,height=830,toolbar=0,location=0,resizable=0,scrollbars=1');
}

function stop(){
	document.aud_1.Stop();
	new Ajax.Updater (
		"controller", "audio_play_state.php?state=stop", 
		{}
	);
}
function play(){
	document.aud_1.Play();
	new Ajax.Updater (
		"controller", "audio_play_state.php?state=play", 
		{}
	);
}

function openWin(url){
	eidtWin = window.open(url,'creator','left=20,top=20,width=900,height=800,scrollbars=1,toolbar=1,location=1,resizable=1');
}

function load(path){
    artist_updater = new Ajax.PeriodicalUpdater(
        'artist',
        path+'updater_artist.php?path='+path,
        {
            method: 'get',
            frequency: 11
        }
    )
			
    sponsor_updater = new Ajax.PeriodicalUpdater(
        'sponsor',
        path+'updater_sponsor.php?path='+path,
        {
            method: 'get',
            frequency: 6
        }
    )
			
    vendor_updater = new Ajax.PeriodicalUpdater(
        'vendor',
        path+'updater_vendor.php?path='+path,
        {
            method: 'get',
            evalScripts: true,
            frequency: 17
        }
    )
		
}
