// JavaScript Document



function calcDoorsSGD () {

var style = document.slidingdoorpricer.glass.value

var width = document.slidingdoorpricer.width.value
var height = document.slidingdoorpricer.height.value

//Size Validation

if (width < 750)
   {
   alert("Minumum Width 750mm");
   }
   
if (width > 1250)
   {
   alert("Maximum Width 1250mm");
   }
   
   
	
if (height < 1500)
   {
   alert("Minimum Height 1500mm");
   }

if (height > 2500)
   {
   alert("Maximum Height 2500mm");
   }

//------- CLEAR GLASS PRICING----------- //

if (style =='Clear')

{

if (width >= 750 && width <= 900 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1052 }
  
else if (width >= 750 && width <= 900 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1066 }
 
else if (width >= 750 && width <= 900 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1079 }


 // 
 
if (width >= 901 && width <= 1000 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1162 }
  
else if (width >= 901 && width <= 1000 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1177 }
 
else if (width >= 901 && width <= 1000 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1192 }

 // 
 
else if (width >= 1001 && width <= 1120 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1194 }
  
else if (width >= 1001 && width <= 1120 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1211 }
 
else if (width >= 1001 && width <= 1120 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1227 }
 
 // 
 
else if (width >= 1121 && width <= 1250 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1228 }
  
else if (width >= 1121 && width <= 1250 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1246 }
 
else if (width >= 1121 && width <= 1250 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1265 }
 
}

//------- SATIN/CHINCHILLA GLASS PRICING----------- //

if (style == 'Satin' || style == 'Chinchilla')

{

if (width >= 750 && width <= 900 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1148 }
  
else if (width >= 750 && width <= 900 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1171 }
 
else if (width >= 750 && width <= 900 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1194 }


 // 
 
if (width >= 901 && width <= 1000 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1269 }
  
else if (width >= 901 && width <= 1000 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1294 }
 
else if (width >= 901 && width <= 1000 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1319 }

 // 
 
else if (width >= 1001 && width <= 1120 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1314 }
  
else if (width >= 1001 && width <= 1120 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1342 }
 
else if (width >= 1001 && width <= 1120 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1370 }
 
 // 
 
else if (width >= 1121 && width <= 1250 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1362 }
  
else if (width >= 1121 && width <= 1250 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1393 }
 
else if (width >= 1121 && width <= 1250 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1424 }
 
}

//------- BRONZE/GREEN/GREY GLASS PRICING----------- //

if (style == 'Bronze' || style == 'Green' || style == 'Grey')

{

if (width >= 750 && width <= 900 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1110 }
  
else if (width >= 750 && width <= 900 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1129 }
 
else if (width >= 750 && width <= 900 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1148 }


 // 
 
if (width >= 901 && width <= 1000 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1226 }
  
else if (width >= 901 && width <= 1000 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1247 }
 
else if (width >= 901 && width <= 1000 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1268 }

 // 
 
else if (width >= 1001 && width <= 1120 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1266 }
  
else if (width >= 1001 && width <= 1120 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1289 }
 
else if (width >= 1001 && width <= 1120 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1313 }
 
 // 
 
else if (width >= 1121 && width <= 1250 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1308 }
  
else if (width >= 1121 && width <= 1250 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1334 }
 
else if (width >= 1121 && width <= 1250 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1360 }
 
}

//------- CHINCHILLA_BRONZE GLASS PRICING----------- //

if (style == 'Chinchilla_Bronze')

{

if (width >= 750 && width <= 900 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1198 }
  
else if (width >= 750 && width <= 900 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1225 }
 
else if (width >= 750 && width <= 900 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1253 }


 // 
 
if (width >= 901 && width <= 1000 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1324 }
  
else if (width >= 901 && width <= 1000 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1354 }
 
else if (width >= 901 && width <= 1000 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1384 }

 // 
 
else if (width >= 1001 && width <= 1120 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1376 }
  
else if (width >= 1001 && width <= 1120 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1409 }
 
else if (width >= 1001 && width <= 1120 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1443 }
 
 // 
 
else if (width >= 1121 && width <= 1250 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1430 }
  
else if (width >= 1121 && width <= 1250 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1468 }
 
else if (width >= 1121 && width <= 1250 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1506 }
 
}

//------- BLUE GLASS PRICING----------- //

if (style == 'Blue')

{

if (width >= 750 && width <= 900 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1132 }
  
else if (width >= 750 && width <= 900 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1153 }
 
else if (width >= 750 && width <= 900 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1174 }


 // 
 
if (width >= 901 && width <= 1000 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1251 }
  
else if (width >= 901 && width <= 1000 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1274 }
 
else if (width >= 901 && width <= 1000 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1297 }

 // 
 
else if (width >= 1001 && width <= 1120 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1293 }
  
else if (width >= 1001 && width <= 1120 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1319 }
 
else if (width >= 1001 && width <= 1120 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1345 }
 
 // 
 
else if (width >= 1121 && width <= 1250 && height >= 1500 && height <= 2100) 
 {document.slidingdoorpricer.finalprice.value= 1339 }
  
else if (width >= 1121 && width <= 1250 && height >= 2101 && height <= 2300) 
 {document.slidingdoorpricer.finalprice.value= 1368 }
 
else if (width >= 1121 && width <= 1250 && height >= 2301 && height <= 2500) 
 {document.slidingdoorpricer.finalprice.value= 1397 }
 
}

 if (style == '-'){
alert("Please Select A Glass Style");
}

}


function extrasSGD () {
 // Brilliant Star Design Check Box
if (document.slidingdoorpricer.starcut.checked) {
document.slidingdoorpricer.brill.value=99
		}
		
if (document.slidingdoorpricer.starcut.checked == false) {
document.slidingdoorpricer.brill.value=0
		}

	
// Delivery Radio Buttons
if (document.slidingdoorpricer.del[0].checked) {
		document.slidingdoorpricer.deliv.value=0
	} 
	
if (document.slidingdoorpricer.del[1].checked) {
		document.slidingdoorpricer.deliv.value=30
	} 
	}



function calcPriceSGD () {
var pricex = document.slidingdoorpricer.finalprice.value
pricex = Number(pricex)
var cutstar = document.slidingdoorpricer.brill.value
cutstar = Number(cutstar)
var delivery = document.slidingdoorpricer.deliv.value
delivery = Number(delivery)

document.slidingdoorpricer.cost.value = pricex 

var total = (pricex + cutstar + delivery)

document.slidingdoorpricer.totalcost.value = total * 2

document.slidingdoorpricer.half.value = total

// VAT

var vats = total * 0.175

//round up vat to two decimals
	var vatresult=Math.round(vats*100)/100
	//
vatresult = Number(vatresult)

document.slidingdoorpricer.vatprice.value = vatresult

document.slidingdoorpricer.wpvat.value = vatresult + total

document.slidingdoorpricer.youpay.value = total


}






