function alterImage(elem, img){
    elem.onerror = null;
    elem.src = img;
}

function searchMode(mode){
    var freeword = document.getElementById('freeword');
    var tagword = document.getElementById('tagword');
    if(mode == 'tagword'){
        freeword.style.display = 'none';
        tagword.style.display = 'block';
    }else{
        freeword.style.display = 'block';
        tagword.style.display = 'none';
    }
    return false;
}

/* Goods Detail Page */
function openDtlWin(temp_url, w, h){
    if(w == null){
        w = 450;
    }
    if(h == null){
        h = 450;
    }
    var dw = window.open(temp_url, "large", "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scroll=yes");
    dw.focus();
    return false;
}

function addGoodsToCart(form, btnValue){
	var defaultAction = form.action;
	form.ORD_TP.value = 1;
	var whereTo = defaultAction + "?CART_BTN_FLAG=" + btnValue;
	form.action = whereTo;
	return ok(form);
}

function directOrder(form, btnValue){
	var defaultAction = form.action;
	form.ORD_TP.value = 2;
	var whereTo = defaultAction + "?CART_BTN_FLAG=" + btnValue;
	form.action = whereTo;
	return ok(form);
}

function directYOrder(form, btnValue){
	form.Yorder.value = "true";
	return directOrder(form, btnValue);
}

function addGoodsToRsv(form){
    form.ORD_TP.value = "CART_RSV_GOODS";
    return ok(form);
}

function addWishList(form){
    form.ORD_TP.value = "CART_WISH_LIST";
    return ok(form);
}

function moveToGoods(goodsNo, grpId, att1, att2){
    location.href="?GOODS_NO=" + goodsNo + "&ATT_GRP_ID=" + grpId + "&ATT1_CD=" + att1 + "&ATT2_CD=" + att2;
}

/* 2007.06.12 e.satoh テレ朝様専用スクリプト追加 start */
/*
  サブウィンドウを表示します。

  @param temp_url 表示するJSP
  @param w ウィンドウ幅
  @param h ウィンドウ高さ
*/
function openSubWin(temp_url, w, h)
{
    if(w == null){
        w = 450;
    }
    if(h == null){
        h = 450;
    }
    var dw = window.open(temp_url, "large", "height=" + h + ",width=" + w + ",status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes");
    dw.focus();
    return false;
}

function openZoomWin(goodsNo , detailTp)
{
    w = 510;
    h = 550;
    temp_url = "../disp/CEtaDetailGdsImage.jsp?GOODS_NO=" + goodsNo + "&DTL_TP=" + detailTp;
    openSubWin(temp_url, w, h);
}
/*
  動画表示用ウィンドウを表示します。

  @param goodsNm 商品名
  @param imgUrl 動画URL
*/
function openMovieWin(movieUrl)
{
    wo = window.open(movieUrl ,"PopInfo","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=600,height=400");
    wo.focus();
}
/* 2007.06.12 e.satoh テレ朝様専用スクリプト追加 end */

