﻿function OpenWin(url,width,height) {

    Win_w = window.screen.width;
    Win_h = window.screen.height;

    if(width) {
        OpenWin_w = width;
    }
    else {
        OpenWin_w = Win_w / 3 * 2;
    }
    if(height) {
        OpenWin_h = height;
    }
    else {
        OpenWin_h = Win_h / 5 * 4;
    }
    
    OpenWin_x = parseInt(Win_w - OpenWin_w) / 2;
    OpenWin_y = parseInt(Win_h - OpenWin_h) / 2;

    window.open(url,'Win1','width='+OpenWin_w+',height='+OpenWin_h+',scrollbars=yes,resizable=yes,status=no,toolbar=no,left='+OpenWin_x+',top='+OpenWin_y);
}

function SubmitReload(URL) {
    window.document.forms[0].submit();
    ReloadTimer = setTimeout("OpenerReload(URL)", 20);
    clearTimeout(ReloadTimer);
    window.opener.location.href = URL;
}

function CloseReload(URL,Reload) {
    if(Reload) {
        ReloadTimer = setTimeout("OpenerReload(URL)", 20);
        clearTimeout(ReloadTimer);
        window.opener.location.href = URL;
    }
    window.close();
}

function OpenerReload(URL) {
    window.opener.location.href = URL;
}

function BackView(URL) {
    location.href=URL;
}

function addCart(i_num) {
    window.document.itemListForm.target.value = i_num;
    window.document.itemListForm.submit();
}
