/**
 * 右メニューのjavascript
 */

 var _date = new Date();

/**
 * カートに追加
 * @param {Object} itemdid
 */
function setcart(itemdid){
		jQuery.post("/ec/cart/cart.php?" + _date.getTime(),{act:'add',iid:itemdid},function(data){if(data.length == 0){showCartParts();$('#cartMessage').jqmShow();}else{alert(data)}});
}

/**
 * カートパーツを再表示
 */
function showCartParts(){
	jQuery.post("/parts_get.php?" + _date.getTime(),{partsId:41},function(data){jQuery("#cart").html(data);});
}


/**
 * カートの中身削除
 */
function cartlistdel(itemdid){
		jQuery.post("/ec/cart/cart.php?" + _date.getTime(),{act:'del',iid:itemdid},function(data){showCartParts()});
}

/**
 * 最近チェックした商品削除
 */
function checkdel(itemdid){
		jQuery.post("/ec/item/item.php?" + _date.getTime(),{act:'checkDel',iid:itemdid},function(data){showItemCheckParts()});
}
/**
 * 最近チェックした商品再表示
 */
function showItemCheckParts(){
	jQuery.post("/parts_get.php?" + _date.getTime(),{partsId:44},function(data){jQuery("#checkitem").html(data)});
}

/**
 * お気に入りに追加
 * @param {Object} itemdid
 */
function setfav(itemdid){
		jQuery.post("/ec/item/item.php?" + _date.getTime(),{act:'favAdd',iid:itemdid},function(data){showItemFavParts()});
}

/**
 * お気に入り削除
 */
function favdel(itemdid){
		jQuery.post("/ec/item/item.php?" + _date.getTime(),{act:'favDel',iid:itemdid},function(data){showItemFavParts()});
}

/**
 * お気に入り再表示
 */
function showItemFavParts(){
	jQuery.post("/parts_get.php?" + _date.getTime(),{partsId:41},function(data){jQuery("#favitem").html(data)});
}

/**
 * モバイルサイトメール送信
 * @param {Object} itemdid
 */
function sendMobMail(sendform){
		jQuery.post("/ec/send_mob_site_mail.php?" + _date.getTime(),jQuery(sendform).serialize(),function(data){if(data!=""){alert(data);}else{alert("メールを送信しました")}});
}

/**
 * メニューの開閉
 * @param {Object} tagid
 */
function menuSlide(tagid){
	if(jQuery("#"+tagid).is(":hidden")){
		jQuery("#"+tagid).slideDown();
	}else{
		jQuery("#"+tagid).slideUp();
	}
}

