

function sheetThickness( idStock, sheetQty ) {

	return 0 * sheetQty;
}

function bindingThickness( idBinding ) {

	if( idBinding == 78 )
			return 32/1;
	if( idBinding == 79 )
			return 32/2;
	if( idBinding == 80 )
			return 32/2;
	if( idBinding == 81 )
			return 32/2;
	if( idBinding == 89 )
			return 32/2;

	return -1;
}

function bindingMessage( stockThickness ) {
	var warningMsg = "";
	var bindString = "";
	var bindList;

	if( stockThickness <= (32/2) )
		bindString = bindString + "HardBack Window Cut Out - no Foil Blocking|";
	if( stockThickness <= (32/2) )
		bindString = bindString + "HardBack, Foil Block Cover 12 lines+spine|";
	if( stockThickness <= (32/1) )
		bindString = bindString + "HardBack, Foil Block Cover 3 lines+spine|";
	if( stockThickness <= (32/2) )
		bindString = bindString + "HardBack, Foil Block Cover 6 lines+spine|";
	if( stockThickness <= (32/2) )
		bindString = bindString + "HardBack, Foil Block Cover 9 lines+spine|";


	bindList = bindString.split("|");

	warningMsg=warningMsg+"Sorry, "+optionText( document.PriceCalc.PageQty );
	warningMsg=warningMsg+" on "+optionText( document.PriceCalc.StockA );
	warningMsg=warningMsg+" is too thick for "+optionText( document.PriceCalc.Extra2 )+".\n\n";
	
	if( bindString != "" ) {
		warningMsg=warningMsg+"Consider using ";
		for(i=0; i<bindList.length-1; i++ ) {
			if( i == 0 ) {
				warningMsg=warningMsg+bindList[i];
			} else if( i == bindList.length-2 ) {
				warningMsg=warningMsg+" or "+bindList[i];
			} else {
				warningMsg=warningMsg+", "+bindList[i];
			}
		}	
		warningMsg=warningMsg+" for books this size, or contact us directly to discuss other binding options.";
	} else {
		warningMsg=warningMsg+"We don't currently have any bindings on our website for a book this size - please contact us directly to discuss other binding options.";
	}
	alert( warningMsg );
}

function optionText( objSelect ) {
	var idValue = objSelect.value;
	
	for(i=0; i<objSelect.options.length; i++ ) {
		if( objSelect.options[i].value == idValue ) {
			return objSelect.options[i].innerHTML;
		}
	}
	
	return "unknown";
}

function quoteToggleCover() {

	if( document.PriceCalc.UseB.value == 0 ){
		//alert("--A--");
		document.getElementById("coverElem1").style.display = "none";
		document.getElementById("coverElem2").style.display = "none";
		document.getElementById("coverElem3").style.display = "none";
		document.getElementById("coverElem4").style.display = "none";
		document.getElementById("coverElem5").style.display = "none";
	}else{
		//alert("--B--");
		document.getElementById("coverElem1").style.display = "block";
		document.getElementById("coverElem2").style.display = "block";
		document.getElementById("coverElem3").style.display = "block";
		document.getElementById("coverElem4").style.display = "block";
		document.getElementById("coverElem5").style.display = "block";
	}
}

