/*-----------------------------------------------------
Price Check
CharaSet: Shift_Jis
----------------------------------------------------- */
var TargetPriceId;


/*-----------------------------------------------------
PriceInfo Display
----------------------------------------------------- */

if (document.getElementById){
	document.write('<style type="text/css"><!-- #PriceInfo{display:none;} --><'+'/style>');
	document.getElementById('PriceInfoBtn').src='/images/btn/btn_checkoutsmall.gif';
}

function PriceDisp(id){
	if(document.getElementById(id).style.display=="block"){
		document.getElementById(id).style.display="none";
		document.getElementById(id+'Btn').src="/images/btn/btn_checkoutsmall.gif";
	}else{
		document.getElementById(id).style.display="block";
		document.getElementById(id+'Btn').src="/images/btn/btn_checkoutsmall_gray.gif";
	}
}

function OrderJump(){
	document.getElementById('PriceInfo').style.display="block";
	document.getElementById('PriceInfoBtn').src="/images/btn/btn_checkoutsmall_gray.gif";
	location.hash='ProdInfo';
}

/*-----------------------------------------------------
	Price Desc Show
----------------------------------------------------- */
function fnPopuPrice(TargetPriceId){
	/* ターゲットID決定　================================ */
	var TargetPriceTid = 'pricet'+TargetPriceId; //商品形態取得用
	var TargetPriceDid = 'delivery'; //説明表示用

	/* 商品形態取得 ====================================== */
	var HtmlPopupTitle = document.getElementById(TargetPriceTid).innerHTML;

	/* 表示内容決定 ====================================== */
	var HtmlPopup ='';
	var HtmlPopupItem ='';

	/* 提供形態マッチング */

	if(HtmlPopupTitle.match(/Hard Copy/i)){
		HtmlPopupItem += '<div class="delivery_t">Hard Copy</div><div class="delivery_d">Approx. 3-4 business days</div>';
	}
	if(HtmlPopupTitle.match(/CD\-ROM/i)){
		HtmlPopupItem += '<div class="delivery_t">CD-ROM</div><div class="delivery_d">Approx. 3-4 business days</div>';
	}
	if(HtmlPopupTitle.match(/(e\-|e)mail/i)){
		HtmlPopupItem += '<div class="delivery_t">E-Mail</div><div class="delivery_d">Approx. 1-2 business days</span></div>';
	}
	if(HtmlPopupTitle.match(/Web Access/i)){
		HtmlPopupItem += '<div class="delivery_t">Web Access</div><div class="delivery_d">Approx. 1-2 business days</div>';
	}

	/* ファイル形式マッチング */

	if(HtmlPopupTitle.match(/PPT/i)){
		HtmlPopupItem += '<dt style="font-weight:bold;">PPT</div><div class="delivery_d">Microsoft PowerPoint</dd>';
	}

	// 表示内容がある場合
	if (HtmlPopupItem){
		HtmlPopup = HtmlPopupItem;

	}else{
		HtmlPopup  = '<div class="delivery_t">PDF by E-Mail</div><div class="delivery_d">Approx. 1-2 business days</div>';
		HtmlPopup += '<div class="delivery_t">Hard Copy/CD-ROM</div><div class="delivery_d">Approx. 3-4 business days</div>';
		
	}
	HtmlPopup += '<div style="color:red;padding-left:5px;">If you need expedited delivery, please call us.</div>';
	document.getElementById(TargetPriceDid).innerHTML=HtmlPopup;
	
}


/*-----------------------------------------------------
	Price Desc Hide
----------------------------------------------------- */
function fnPopdPrice(TargetPriceId){
//	var TargetPriceDid = 'priced';
//	var TargetPriceDid = 'priced';
//	document.getElementById(TargetPriceDid).innerHTML='';
//	document.getElementById(TargetPriceDid).style.display='none';

}


/*-----------------------------------------------------
	Price Change Background Color & Show / Hide Desc
----------------------------------------------------- */
function fnPriceInfo(TargetPriceId){
	if(document.order.pricedata.length == undefined){
		document.order.pricedata.checked=true;
	}else{
		document.order.pricedata[TargetPriceId].checked=true;
	}
	fnPopuPrice(TargetPriceId);
}

function fnBGslctOn(TargetPriceId){
	document.getElementById("pricef"+TargetPriceId).style.background='#ffeecc';
}

function fnBGslctOff(TargetPriceId){
	document.getElementById("pricef"+TargetPriceId).style.background='#fcfcff';
}

/*-----------------------------------------------------
	Price Radio Check;
----------------------------------------------------- */
function form_check(f) {
	check_flug = false;
	if (f.pricedata.length == undefined){
		f.pricedata.checked = true;
		return true;
	}
	for (i=0;i<f.pricedata.length;i++){
		if(f.pricedata[i].checked == true){
			check_flug = true;
		}
	}
	if (check_flug == true){
		return true;
	}else{
		alert("Please Select Product Format");
		return false;
	}
}
