function HQframesAddEndRow() {

	//prompt("TEST")

 

var getTable3 = document.getElementById('HQFrames');

var countRow3 = getTable3.rows.length; 

var iteration3=countRow3;





var HQfTR=document.createElement('tr');

var HQfTD=document.createElement('td');

var sel = document.createElement('select');



 sel.name = "hqFrameType["+iteration3+"]";

 sel.id="hqFrameType["+iteration3+"]";
 
 sel.options[0] = new Option('5 inch Queen Elizabeth', '5 inch Queen Elizabeth');

 sel.options[1] = new Option('6 inch fruits', '6 inch fruits');

 sel.options[2] = new Option('6 inch-franklin', '6 inch-franklin');
 
 sel.options[3] = new Option('6 inch victorian', '6 inch victorian');
 
 sel.options[4] = new Option('6 inch Roman', '6 inch Roman');

 sel.options[5] = new Option('8 inch-royal', '8 inch-royal');

 sel.options[6] = new Option('8 inch-classic', '8 inch-classic');

 sel.options[7] = new Option('8 inch-excellency', '8 inch-excellency');

 sel.options[7] = new Option('8 inch-palms', '8 inch-palms');

 sel.options[8] = new Option('8 inch majestic frame', '8 inch majestic frame');
 sel.options[9] = new Option('8 inch Marie Antoinette', '8 inch Marie Antoinette');

 sel.options[10] = new Option('10 inch-tower', '10 inch-tower');
 


 

 

sel.onchange=function(){onchangHQFrameType2(this.value,iteration3); HQframesUnitPrice2(iteration3);startCalHQframe2(iteration3);}; 

sel.onfocus=function(){startCalHQframe2(iteration3);}; 

sel.onblur=function(){stopCalHQframe2();};

HQfTD.appendChild(sel);







//------------------------------------------

var HQfTD2=document.createElement('td');



 var cat = document.createElement('select');

 cat.name = "hqFrameColor["+iteration3+"]";

 cat.id="hqFrameColor["+iteration3+"]";

 cat.options[0] = new Option('Mixed', 'Mixed');

 cat.options[1] = new Option('Black', 'Black');

 cat.options[2] = new Option('Cherry', 'Cherry');

 cat.options[3] = new Option('Gold', 'Gold');

// cat.options[4] = new Option('Honey', 'Honey');

 cat.options[4] = new Option('Mahagony', 'Mahagony');

 //cat.options[5] = new Option('Marble', 'Marble');

 cat.options[5] = new Option('Silver', 'Silver');
 cat.options[6] = new Option('Cherry & Gold', 'Cherry & Gold');
 cat.options[7] = new Option('Bronze', 'Bronze');


cat.onfocus=function(){startCalHQframe2(iteration3);}; 

cat.onblur=function(){stopCalHQframe2();};

HQfTD2.appendChild(cat);



//-----------------------------------------------------------



var HQfTD3=document.createElement('td');

var sell = document.createElement('select');

 sell.name = "hqFrameSize["+iteration3+"]";

 sell.id="hqFrameSize["+iteration3+"]";

/* sell.options[0] = new Option('5x7', '5x7');*/

 sell.options[0] = new Option('8x10', '8x10');

 sell.options[1] = new Option('12x16', '12x16');

 sell.options[2] = new Option('16x20', '16x20'); 

 sell.options[3] = new Option('20x24', '20x24');

 sell.options[4] = new Option('24x30', '24x30');

 sell.options[5] = new Option('24x36', '24x36');

 sell.options[6] = new Option('24x48', '24x48'); 

 sell.options[7] = new Option('30x40', '30x40');
 
 sell.options[8] = new Option('36x48', '36x48');
 
 sell.options[9] = new Option('48x60', '48x60');
 
 sell.options[10] = new Option('48x72', '48x72');

 

sell.onchange=function(){HQframesUnitPrice2(iteration3);};



sell.onfocus=function(){startCalHQframe2(iteration3);}; 

sell.onblur=function(){stopCalHQframe2();};



HQfTD3.appendChild(sell);





//----------------------------------



var HQfTD4=document.createElement('td');



var cusSize = document.createElement('input');

 cusSize.type = 'text'; 

 cusSize.size=13; 

 cusSize.id = "hqFrameCustomeSize["+iteration3+"]";

 cusSize.name = "hqFrameCustomeSize["+iteration3+"]";

 

cusSize.onfocus=function(){startCustomesize2(iteration3);};

cusSize.onblur=function(){stopCustomesize2();};

HQfTD4.appendChild(cusSize);  

//-----------------------------

var HQfTD5=document.createElement('td');



var quantity = document.createElement('input');

 quantity.type = 'text'; 

 quantity.value=''; 

 quantity.size=13;

 

 quantity.name = "hqFrameQuantity["+iteration3+"]";

 quantity.id="hqFrameQuantity["+iteration3+"]";

// up.disabled='disabled';

quantity.onclick=function(){checkHQframesizeavalibility2(iteration3);HQframesUnitPrice2(iteration3);}; 

quantity.onfocus=function(){startCalHQframe2(iteration3);}; 

quantity.onblur=function(){stopCalHQframe2();}; 

 HQfTD5.appendChild(quantity);

//---------------------------





var HQfTD6=document.createElement('td');





var up = document.createElement('input');

 up.type = 'hidden'; 

 up.value=''; 

 up.size=13;

 //st.disabled='disabled';

 up.id = "hqUnitPriceDisplay["+iteration3+"]"; 

 up.name="hqUnitPriceDisplay["+iteration3+"]"; 

 



upd = document.createElement('div');

upd.innerHTML = "";

upd.name = "hqup"+iteration3;

upd.id = "hqup"+iteration3; 



 HQfTD6.appendChild(up);

  HQfTD6.appendChild(upd);

//---------------------------



var HQfTD7=document.createElement('td');





var st = document.createElement('input');
st.type = 'hidden';
st.value=''; 
st.size=13;
st.id = "hqFramesSubTotalDis["+iteration3+"]"; 
st.name = "hqFramesSubTotalDis["+iteration3+"]"; 

 

std = document.createElement('div');
std.innerHTML = "";
std.align="right";
std.name = "hqst"+iteration3;
std.id = "hqst"+iteration3; 

 

 

HQfTD7.appendChild(st);

HQfTD7.appendChild(std);

//---------------------------



HQfTR.appendChild(HQfTD);

HQfTR.appendChild(HQfTD2);

HQfTR.appendChild(HQfTD3);

HQfTR.appendChild(HQfTD4);

HQfTR.appendChild(HQfTD5);

HQfTR.appendChild(HQfTD6);

HQfTR.appendChild(HQfTD7);



document.getElementById('HQFrames').appendChild(HQfTR);



}





//-----------------------------------------------------------------		

	

function HQframesremoveRow()

{

  var tbl = document.getElementById('HQFrames');

  var lastRow = tbl.rows.length;

  if (lastRow > 2) tbl.deleteRow(lastRow - 1);

}







//----------------------------------------------------



//var valUnitPrice;

//var subtotalHQFrame;





function onchangHQFrameType2(hqFT,iterationhq){	



var hqFrameSizeId="hqFrameSize["+iterationhq+"]";
var hqFramecolorId="hqFrameColor["+iterationhq+"]";



		

var frametype=hqFT;



var lb=document.getElementById(hqFrameSizeId);
var lc=document.getElementById(hqFramecolorId);

switch (frametype){
	
	
case ('5 inch Queen Elizabeth'):


for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }

document.getElementById(hqFrameSizeId).options[0]=new Option('8x10', '8x10');
document.getElementById(hqFrameSizeId).options[1]=new Option('12x16', '12x16');
document.getElementById(hqFrameSizeId).options[2]=new Option('16x20', '16x20');
document.getElementById(hqFrameSizeId).options[3]=new Option('20x24', '20x24');
document.getElementById(hqFrameSizeId).options[4]=new Option('20x30', '20x30');
document.getElementById(hqFrameSizeId).options[5]=new Option('24x30', '24x30');
document.getElementById(hqFrameSizeId).options[6]=new Option('24x36', '24x36');
document.getElementById(hqFrameSizeId).options[7]=new Option('24x48', '24x48');
document.getElementById(hqFrameSizeId).options[8]=new Option('30x40', '30x40');
document.getElementById(hqFrameSizeId).options[9]=new Option('36x48', '36x48');
document.getElementById(hqFrameSizeId).options[10]=new Option('48x60', '48x60');
document.getElementById(hqFrameSizeId).options[11]=new Option('48x72', '48x72');



for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }

 //lc.options[0] = new Option('Mixed', 'Mixed');
 lc.options[0] = new Option('Black', 'Black');
 lc.options[1] = new Option('Cherry', 'Cherry');
 lc.options[2] = new Option('Gold', 'Gold');
 lc.options[3] = new Option('Bronze', 'Bronze');
 lc.options[4] = new Option('Mahagony', 'Mahagony');
 lc.options[5] = new Option('Silver', 'Silver');
 //lc.options[7] = new Option('Cherry & Gold', 'Cherry & Gold');


break

case ('6 inch fruits'):
case ('8 inch-royal'):
case ('8 inch-classic'):
case ('8 inch-excellency'):
case ('8 inch-palms'):
case ('8 inch majestic frame'):



for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }

document.getElementById(hqFrameSizeId).options[0]=new Option('8x10', '8x10');
document.getElementById(hqFrameSizeId).options[1]=new Option('12x16', '12x16');
document.getElementById(hqFrameSizeId).options[2]=new Option('16x20', '16x20');
document.getElementById(hqFrameSizeId).options[3]=new Option('20x24', '20x24');
document.getElementById(hqFrameSizeId).options[4]=new Option('20x30', '20x30');
document.getElementById(hqFrameSizeId).options[5]=new Option('24x30', '24x30');
document.getElementById(hqFrameSizeId).options[6]=new Option('24x36', '24x36');
document.getElementById(hqFrameSizeId).options[7]=new Option('24x48', '24x48');
document.getElementById(hqFrameSizeId).options[8]=new Option('30x40', '30x40');
document.getElementById(hqFrameSizeId).options[9]=new Option('36x48', '36x48');
document.getElementById(hqFrameSizeId).options[10]=new Option('48x60', '48x60');
document.getElementById(hqFrameSizeId).options[11]=new Option('48x72', '48x72');



for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }

 lc.options[0] = new Option('Mixed', 'Mixed');
 lc.options[1] = new Option('Black', 'Black');
 lc.options[2] = new Option('Cherry', 'Cherry');
 lc.options[3] = new Option('Gold', 'Gold');
 lc.options[4] = new Option('Mahagony', 'Mahagony');
 //lc.options[5] = new Option('Marble', 'Marble');
 lc.options[5] = new Option('Silver', 'Silver');
 lc.options[6] = new Option('Cherry & Gold', 'Cherry & Gold');
 lc.options[7] = new Option('Bronze', 'Bronze');
 
  
  
  

break


case ('6 inch-franklin'):
case ('6 inch Roman'):

for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }

document.getElementById(hqFrameSizeId).options[0]=new Option('8x10', '8x10');

document.getElementById(hqFrameSizeId).options[1]=new Option('12x16', '12x16');

document.getElementById(hqFrameSizeId).options[2]=new Option('16x20', '16x20');

document.getElementById(hqFrameSizeId).options[3]=new Option('20x24', '20x24');
document.getElementById(hqFrameSizeId).options[4]=new Option('20x30', '20x30');
document.getElementById(hqFrameSizeId).options[5]=new Option('24x30', '24x30');

document.getElementById(hqFrameSizeId).options[6]=new Option('24x36', '24x36');

document.getElementById(hqFrameSizeId).options[7]=new Option('24x48', '24x48');

document.getElementById(hqFrameSizeId).options[8]=new Option('30x40', '30x40');

document.getElementById(hqFrameSizeId).options[9]=new Option('36x48', '36x48');

document.getElementById(hqFrameSizeId).options[10]=new Option('48x60', '48x60');

document.getElementById(hqFrameSizeId).options[11]=new Option('48x72', '48x72');



for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }

 lc.options[0] = new Option('Mixed', 'Mixed');
 lc.options[1] = new Option('Black', 'Black');
 lc.options[2] = new Option('Cherry', 'Cherry');
 lc.options[3] = new Option('Gold', 'Gold');
 lc.options[4] = new Option('Mahagony', 'Mahagony');
// lc.options[5] = new Option('Marble', 'Marble');
 lc.options[5] = new Option('Silver', 'Silver');
 lc.options[6] = new Option('Cherry & Gold', 'Cherry & Gold');
  lc.options[7] = new Option('Red & Gold', 'Red & Gold');
   lc.options[8] = new Option('Bronze', 'Bronze');
    lc.options[9] = new Option('Marble & Gold', 'Marble & Gold');


break




case ('8 inch Marie Antoinette'):




for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }



document.getElementById(hqFrameSizeId).options[0]=new Option('20x30', '20x30');

document.getElementById(hqFrameSizeId).options[1]=new Option('24X30', '24X30');

//document.getElementById(hqFrameSizeId).options[2]=new Option('36x48', '36x48');



for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }
  
  
lc.options[0] = new Option('Mixed', 'Mixed');
lc.options[1] = new Option('Unfinished', 'Unfinished');
lc.options[2] = new Option('Cherry', 'Cherry');
lc.options[3] = new Option('Gold', 'Gold');
lc.options[4] = new Option('Mahagony', 'Mahagony');
lc.options[5] = new Option('Silver', 'Silver');
lc.options[6] = new Option('Bronze', 'Bronze');


break





case ('6 inch victorian'):


for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }


document.getElementById(hqFrameSizeId).options[0]=new Option('8x10', '8x10');
document.getElementById(hqFrameSizeId).options[1]=new Option('12x16', '12x16');
document.getElementById(hqFrameSizeId).options[2]=new Option('16x20', '16x20');
document.getElementById(hqFrameSizeId).options[3]=new Option('20x24', '20x24');
document.getElementById(hqFrameSizeId).options[4]=new Option('20x30', '20x30');
document.getElementById(hqFrameSizeId).options[5]=new Option('24x30', '24x30');
document.getElementById(hqFrameSizeId).options[6]=new Option('24x36', '24x36');
document.getElementById(hqFrameSizeId).options[7]=new Option('24x48', '24x48');
document.getElementById(hqFrameSizeId).options[8]=new Option('30x40', '30x40');
document.getElementById(hqFrameSizeId).options[9]=new Option('36x48', '36x48');
document.getElementById(hqFrameSizeId).options[10]=new Option('48x60', '48x60');
document.getElementById(hqFrameSizeId).options[11]=new Option('48x72', '48x72');

for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }
  
  
lc.options[0] = new Option('Mixed', 'Mixed');
lc.options[1] = new Option('Unfinished', 'Unfinished');
lc.options[2] = new Option('Cherry', 'Cherry');
lc.options[3] = new Option('Gold', 'Gold');
lc.options[4] = new Option('Mahagony', 'Mahagony');
lc.options[5] = new Option('Silver', 'Silver');
lc.options[6] = new Option('Bronze', 'Bronze');

break 





case ('10 inch-tower'):

for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

}

document.getElementById(hqFrameSizeId).options[0]=new Option('24x36', '24x36');

break



}

}



//-------------------------------------------------------------------



var HQit;

function startCustomesize2(iteration){

	

	HQit=iteration;

  intervalfcs = setInterval("customeSizeHQframes2()",1);

}





function customeSizeHQframes2(){

	var customesizeId="hqFrameCustomeSize["+HQit+"]";

	var framesizeId="hqFrameSize["+HQit+"]";

	var subtotalId="hqFramesSubTotalDis["+HQit+"]";

	var UnitPriceId="hqUnitPriceDisplay["+HQit+"]";

	var UnitPricedivId="hqup"+HQit;

	var stdivId="hqst"+HQit;

	

var HQcustomSize=document.getElementById(customesizeId).value;	

var fdisstate=document.getElementById(framesizeId);	

if(HQcustomSize=="")	{fdisstate.disabled=false;



//document.getElementById("hqFramesSubTotalDis[]").value=subtotalHQFrame;

//document.getElementById("hqUnitPriceDisplay").value=valUnitPrice;

}

else{fdisstate.disabled=true;



document.getElementById(subtotalId).value="";

//document.getElementById(framesizeId).value="";

document.getElementById(UnitPriceId).value="";

document.getElementById(UnitPricedivId).innerHTML="";

document.getElementById(stdivId).innerHTML="";



}

	

	}

	





function stopCustomesize2(){

  clearInterval(intervalfcs);

}

//---------------------------------------------------------------



function HQframesUnitPrice2(iteration){

	var frameTypeId="hqFrameType["+iteration+"]";
	var framesizeId="hqFrameSize["+iteration+"]";	
	var UnitPriceId="hqUnitPriceDisplay["+iteration+"]";
	var UnitPricedivId="hqup"+iteration;

	

var HQframeSize=document.getElementById(framesizeId).value;
var HQframeType=document.getElementById(frameTypeId).value;



switch (HQframeType){

case ('5 inch Queen Elizabeth'):
case ('6 inch fruits'):
case ('6 inch-franklin'):
case ('6 inch victorian'):
case ('6 inch Roman'):

			

			switch (HQframeSize){

			case '8x10':
			case '12x16':
			case '16x20':
			case '20x24':

			valUnitPrice = '90.00';			

			break			
			


			case '20x30':

			valUnitPrice = '160.00';			

			break
			
			
			case '24x30':

			valUnitPrice = '160.00';			

			break
			
			
			case '24x36':

			valUnitPrice = '120.00';			

			break
			
			
			
			case '24x48':

			valUnitPrice = '210.00';			

			break

			

			case '30x40':

			valUnitPrice = '150.00';			

			break

			

			case '36x48':

			valUnitPrice = '160.00';			

			break	
			
			
			case '48x60':

			valUnitPrice = '395.00';			

			break

			

			case '48x72':

			valUnitPrice = '325.00';			

			break	

			

			}

break





case ('8 inch-royal'):

case ('8 inch-classic'):

case ('8 inch-excellency'):

case ('8 inch-palms'):

case ('8 inch majestic frame'):



			

			switch (HQframeSize){

			case '8x10':
			case '12x16':
			case '16x20':
			case '20x24':

			valUnitPrice = '100.00';			

			break

	

			case '20x24':

			valUnitPrice = '100.00';			

			break
			
			
			
			case '20x30':

			valUnitPrice = '180.00';			

			break

			

			case '24x30':

			valUnitPrice = '180.00';			

			break

			

			case '24x36':

			//valUnitPrice = '140.00';			
			valUnitPrice = '140.00';

			break

			

			case '24x48':

			valUnitPrice = '250.00';			

			break
			
			
			case '30x40':

			valUnitPrice = '180.00';			

			break
			
			
			case '36x48':

			valUnitPrice = '195.00';			

			break
			
			
			case '48x60':

			valUnitPrice = '395.00';			

			break
			
			
			case '48x72':

			valUnitPrice = '325.00';			

			break

			

			}

break


case ('8 inch Marie Antoinette'):

switch (HQframeSize){



			case '20x30':

			valUnitPrice = '160.00';			

			break
			
	

			case '24X30':

			valUnitPrice = '180.00';			

			break


			

			}

break


case ('10 inch-tower'):

	switch (HQframeSize){

			case '24x36':

			valUnitPrice = '360.00';			

			break



			}

break

}





document.getElementById(UnitPriceId).value=valUnitPrice;

document.getElementById(UnitPricedivId).innerHTML=valUnitPrice;



	}

	

	

	

//---------------------------------------------------------



function checkHQframesizeavalibility2(iteration){

	

	var framesizeid="hqFrameSize["+iteration+"]";

	var customesizeid="hqFrameCustomeSize["+iteration+"]"

var framesize=document.getElementById(framesizeid).value;

var customesize=document.getElementById(customesizeid).value;

//alert ("Please Select a size")

if (framesize=="" && customesize==""){alert ("PLEASE SELECT A SIZE") }

	}



//------------------------------



var subtotalIteration;

function startCalHQframe2(iteration){

	subtotalIteration=iteration;

  intervalHQframe = setInterval("subtotalHQFrames2()",1);

  //interval2 = setInterval("onchangCanvasDepth()",1);

 

}



function subtotalHQFrames2(){

	//HQframesUnitPrice();

var customesizeId="hqFrameCustomeSize["+subtotalIteration+"]";

	var framesizeId="hqFrameSize["+subtotalIteration+"]";

	var subtotalId="hqFramesSubTotalDis["+subtotalIteration+"]";

	var subtotaldivId="hqst"+subtotalIteration;

	var UnitPriceId="hqUnitPriceDisplay["+subtotalIteration+"]";

	var quantitiyId="hqFrameQuantity["+subtotalIteration+"]";

	var customesizeId="hqFrameCustomeSize["+subtotalIteration+"]";

	

var quantityHQFrames=document.getElementById(quantitiyId).value;

var unitPriceHQFrames=document.getElementById(UnitPriceId).value;

var customeSizeHQFrame=document.getElementById(customesizeId).value;

var sizeHQFrame=document.getElementById(framesizeId).value;

	

	if(customeSizeHQFrame=="" && sizeHQFrame!=""){		

 subtotalHQFrame = unitPriceHQFrames*quantityHQFrames;

  //subtotalHQFrame=Math.round(subtotalHQFrame*100)/100   

  subtotalHQFrame=roundNumber(subtotalHQFrame,2);

	}

	else{

		subtotalHQFrame="";		

	}

document.getElementById(subtotalId).value=subtotalHQFrame;	

document.getElementById(subtotaldivId).innerHTML=subtotalHQFrame;		

	}

	

function stopCalHQframe2(){

  clearInterval(intervalHQframe);

  //clearInterval(interval2);

  

}

	













//--------------------------------------------------



var valUnitPrice;

var subtotalHQFrame;





function onchangHQFrameType(hqFT){		

		

var frametype=hqFT;

//var frametype =document.getElementById("hqFrameType[]").value;	

//prompt (frametype)

var lb=document.getElementById("hqFrameSize[]");
var lc=document.getElementById("hqFrameColor[]");

switch (frametype){
	
case ('5 inch Queen Elizabeth'):

for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }


document.getElementById("hqFrameSize[]").options[0]=new Option('8x10', '8x10');
document.getElementById("hqFrameSize[]").options[1]=new Option('12x16', '12x16');
document.getElementById("hqFrameSize[]").options[2]=new Option('16x20', '16x20');
document.getElementById("hqFrameSize[]").options[3]=new Option('20x24', '20x24');
document.getElementById("hqFrameSize[]").options[4]=new Option('20x30', '20x30');
document.getElementById("hqFrameSize[]").options[5]=new Option('24x30', '24x30');
document.getElementById("hqFrameSize[]").options[6]=new Option('24x36', '24x36');
document.getElementById("hqFrameSize[]").options[7]=new Option('24x48', '24x48');
document.getElementById("hqFrameSize[]").options[8]=new Option('30x40', '30x40');
document.getElementById("hqFrameSize[]").options[9]=new Option('36x48', '36x48');
document.getElementById("hqFrameSize[]").options[10]=new Option('48x60', '48x60');
document.getElementById("hqFrameSize[]").options[11]=new Option('48x72', '48x72');


for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }

 //lc.options[0] = new Option('Mixed', 'Mixed');
 lc.options[0] = new Option('Black', 'Black');
 lc.options[1] = new Option('Cherry', 'Cherry');
 lc.options[2] = new Option('Gold', 'Gold');
 lc.options[3] = new Option('Bronze', 'Bronze');
 lc.options[4] = new Option('Mahagony', 'Mahagony');
 lc.options[5] = new Option('Silver', 'Silver');
 //lc.options[7] = new Option('Cherry & Gold', 'Cherry & Gold');



break

case ('6 inch fruits'):
case ('8 inch-royal'):
case ('8 inch-classic'):
case ('8 inch-excellency'):
case ('8 inch-palms'):
case ('8 inch majestic frame'):



for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }


document.getElementById("hqFrameSize[]").options[0]=new Option('8x10', '8x10');
document.getElementById("hqFrameSize[]").options[1]=new Option('12x16', '12x16');
document.getElementById("hqFrameSize[]").options[2]=new Option('16x20', '16x20');
document.getElementById("hqFrameSize[]").options[3]=new Option('20x24', '20x24');
document.getElementById("hqFrameSize[]").options[4]=new Option('20x30', '20x30');
document.getElementById("hqFrameSize[]").options[5]=new Option('24x30', '24x30');
document.getElementById("hqFrameSize[]").options[6]=new Option('24x36', '24x36');
document.getElementById("hqFrameSize[]").options[7]=new Option('24x48', '24x48');
document.getElementById("hqFrameSize[]").options[8]=new Option('30x40', '30x40');
document.getElementById("hqFrameSize[]").options[9]=new Option('36x48', '36x48');
document.getElementById("hqFrameSize[]").options[10]=new Option('48x60', '48x60');
document.getElementById("hqFrameSize[]").options[11]=new Option('48x72', '48x72');


for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }

 lc.options[0] = new Option('Mixed', 'Mixed');
 lc.options[1] = new Option('Black', 'Black');
 lc.options[2] = new Option('Cherry', 'Cherry');
 lc.options[3] = new Option('Gold', 'Gold');
 lc.options[4] = new Option('Mahagony', 'Mahagony');
// lc.options[5] = new Option('Marble', 'Marble');
 lc.options[5] = new Option('Silver', 'Silver');
 lc.options[6] = new Option('Cherry & Gold', 'Cherry & Gold');
 lc.options[7] = new Option('Bronze', 'Bronze');



break


case ('6 inch-franklin'):
case ('6 inch Roman'):

for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }


document.getElementById("hqFrameSize[]").options[0]=new Option('8x10', '8x10');

document.getElementById("hqFrameSize[]").options[1]=new Option('12x16', '12x16');

document.getElementById("hqFrameSize[]").options[2]=new Option('16x20', '16x20');

document.getElementById("hqFrameSize[]").options[3]=new Option('20x24', '20x24');

document.getElementById("hqFrameSize[]").options[4]=new Option('20x30', '20x30');

document.getElementById("hqFrameSize[]").options[5]=new Option('24x30', '24x30');

document.getElementById("hqFrameSize[]").options[6]=new Option('24x36', '24x36');

document.getElementById("hqFrameSize[]").options[7]=new Option('24x48', '24x48');

document.getElementById("hqFrameSize[]").options[8]=new Option('30x40', '30x40');

document.getElementById("hqFrameSize[]").options[9]=new Option('36x48', '36x48');

document.getElementById("hqFrameSize[]").options[10]=new Option('48x60', '48x60');

document.getElementById("hqFrameSize[]").options[11]=new Option('48x72', '48x72');


for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }

 lc.options[0] = new Option('Mixed', 'Mixed');
 lc.options[1] = new Option('Black', 'Black');
 lc.options[2] = new Option('Cherry', 'Cherry');
 lc.options[3] = new Option('Gold', 'Gold');
 lc.options[4] = new Option('Mahagony', 'Mahagony');
 //lc.options[5] = new Option('Marble', 'Marble');
 lc.options[5] = new Option('Silver', 'Silver');
 lc.options[6] = new Option('Cherry & Gold', 'Cherry & Gold');
 lc.options[7] = new Option('Red & Gold', 'Red & Gold');
 lc.options[8] = new Option('Bronze', 'Bronze');
 lc.options[9] = new Option('Marble & Gold', 'Marble & Gold');

break


case ('8 inch Marie Antoinette'):





for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }

document.getElementById("hqFrameSize[]").options[0]=new Option('20x30', '20x30');

document.getElementById("hqFrameSize[]").options[1]=new Option('24x30', '24x30');

//document.getElementById("hqFrameSize[]").options[2]=new Option('36x48', '36x48');




for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }
  
  
lc.options[0] = new Option('Mixed', 'Mixed');
lc.options[1] = new Option('Unfinished', 'Unfinished');
lc.options[2] = new Option('Cherry', 'Cherry');
lc.options[3] = new Option('Gold', 'Gold');
lc.options[4] = new Option('Mahagony', 'Mahagony');
lc.options[5] = new Option('Silver', 'Silver');
lc.options[6] = new Option('Bronze', 'Bronze');

break







case ('6 inch victorian'):


for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

  }


document.getElementById("hqFrameSize[]").options[0]=new Option('8x10', '8x10');
document.getElementById("hqFrameSize[]").options[1]=new Option('12x16', '12x16');
document.getElementById("hqFrameSize[]").options[2]=new Option('16x20', '16x20');
document.getElementById("hqFrameSize[]").options[3]=new Option('20x24', '20x24');
document.getElementById("hqFrameSize[]").options[4]=new Option('20x30', '20x30');
document.getElementById("hqFrameSize[]").options[5]=new Option('24x30', '24x30');
document.getElementById("hqFrameSize[]").options[6]=new Option('24x36', '24x36');
document.getElementById("hqFrameSize[]").options[7]=new Option('24x48', '24x48');
document.getElementById("hqFrameSize[]").options[8]=new Option('30x40', '30x40');
document.getElementById("hqFrameSize[]").options[9]=new Option('36x48', '36x48');
document.getElementById("hqFrameSize[]").options[10]=new Option('48x60', '48x60');
document.getElementById("hqFrameSize[]").options[11]=new Option('48x72', '48x72');

for (var i=lc.options.length-1; i>=0; i--){

    lc.options[i] = null;

  }
  
  
lc.options[0] = new Option('Mixed', 'Mixed');
lc.options[1] = new Option('Unfinished', 'Unfinished');
lc.options[2] = new Option('Cherry', 'Cherry');
lc.options[3] = new Option('Gold', 'Gold');
lc.options[4] = new Option('Mahagony', 'Mahagony');
lc.options[5] = new Option('Silver', 'Silver');
lc.options[6] = new Option('Bronze', 'Bronze');

break 



case ('10 inch-tower'):

for (var i=lb.options.length-1; i>=0; i--){

    lb.options[i] = null;

}



document.getElementById("hqFrameSize[]").options[0]=new Option('24x36', '24x36');



break



}

}







//-------------------------------------------------------------------



function customeSizeHQframes(){

var HQcustomSize=document.getElementById("hqFrameCustomeSize[]").value;	

var fdisstate=document.getElementById("hqFrameSize[]");	

if(HQcustomSize=="")	{fdisstate.disabled=false;



document.getElementById("hqFramesSubTotalDis[]").value=subtotalHQFrame;

document.getElementById("hqUnitPriceDisplay[]").value=valUnitPrice;

document.getElementById("hqup").innerHTML=valUnitPrice;

}

else{fdisstate.disabled=true;



document.getElementById("hqFramesSubTotalDis[]").value="";

//document.getElementById("hqFrameSize[]").value="";

document.getElementById("hqUnitPriceDisplay[]").value="";

document.getElementById("hqup").innerHTML="";



}

	

	}

	



function startCustomesize(){

  intervalfcs = setInterval("customeSizeHQframes()",1);

}



function stopCustomesize(){

  clearInterval(intervalfcs);

}

//---------------------------------------------------------------



/*function test(){

var test=document.getElementById("crt[]").value;

prompt(test)

	}*/

	

function HQframesUnitPrice(){

var HQframeSize=document.getElementById("hqFrameSize[]").value;

var HQframeType=document.getElementById("hqFrameType[]").value;

//var valUnitPrice;





switch (HQframeType){

case ('5 inch Queen Elizabeth'):
case ('6 inch fruits'):
case ('6 inch-franklin'):
case ('6 inch victorian'):
case ('6 inch Roman'):
			

			switch (HQframeSize){

			case '8x10':
			case '12x16':
			case '16x20':
			case '20x24':

			valUnitPrice = '90.00';			

			break
			
			
			
			case '20x30':

			valUnitPrice = '160.00';			

			break
		

			case '24x30':

			valUnitPrice = '160.00';			

			break

			

			case '24x36':

			valUnitPrice = '120.00';			

			break

			

			case '24x48':

			valUnitPrice = '210.00';			

			break
			
			
			case '30x40':

			valUnitPrice = '150.00';			

			break
			
			
			case '36x48':

			valUnitPrice = '160.00';			

			break
			
			
			case '48x60':

			valUnitPrice = '395.00';			

			break
			
			
			case '48x72':

			valUnitPrice = '325.00';			

			break

			

			}

break





case ('8 inch-royal'):
case ('8 inch-classic'):
case ('8 inch-excellency'):
case ('8 inch-palms'):
case ('8 inch majestic frame'):


			

switch (HQframeSize){

			case '8x10':
			case '12x16':
			case '16x20':
			case '20x24':

			valUnitPrice = '100.00';			

			break

		
			case '20x30':

			valUnitPrice = '180.00';

			break
		

			case '24x30':

			valUnitPrice = '180.00';			

			break

			

			case '24x36':

			//valUnitPrice = '180.00';
			valUnitPrice = '140.00';

			break

			

			case '24x48':

			valUnitPrice = '250.00';
			

			break
			
			
			
			case '30x40':

			valUnitPrice = '180.00';			

			break
			
			
			
			case '36x48':

			valUnitPrice = '195.00';			

			break
			
			
			case '48x60':

			valUnitPrice = '395.00';			

			break
			
			
			case '48x72':

			valUnitPrice = '325.00';			

			break

			

			}

break



case ('8 inch Marie Antoinette'):

switch (HQframeSize){


		
			case '20x30':

			valUnitPrice = '160.00';

			break
			
	
			case '24x30':

			//valUnitPrice = '180.00';
			valUnitPrice = '180.00';

			break
	

			}

break


case ('10 inch-tower'):

switch (HQframeSize){
	
case '24x36':

			valUnitPrice = '360.00';			

			break
}

break

}



document.getElementById("hqUnitPriceDisplay[]").value=valUnitPrice;

document.getElementById("hqup").innerHTML=valUnitPrice;

	}

	

	

	

//---------------------------------------------------------



function checkHQframesizeavalibility(){

var framesize=document.getElementById("hqFrameSize[]").value;

var customesize=document.getElementById("hqFrameCustomeSize[]").value;

//alert ("Please Select a size")

if (framesize=="" && customesize==""){alert ("PLEASE SELECT A SIZE") }

	}







//------------------------------



function startCalHQframe(){

  intervalHQframe = setInterval("subtotalHQFrames()",1);

  //interval2 = setInterval("onchangCanvasDepth()",1);

 

}



function subtotalHQFrames(){

	HQframesUnitPrice();

	

var quantityHQFrames=document.getElementById("hqFrameQuantity[]").value;

var unitPriceHQFrames=document.getElementById("hqUnitPriceDisplay[]").value;

var customeSizeHQFrame=document.getElementById("hqFrameCustomeSize[]").value;

var sizeHQFrame=document.getElementById("hqFrameSize[]").value;

	

	if(customeSizeHQFrame=="" && sizeHQFrame!=""){		

 subtotalHQFrame = unitPriceHQFrames*quantityHQFrames;

 //subtotalHQFrame=Math.round(subtotalHQFrame*100)/100 

 subtotalHQFrame=roundNumber(subtotalHQFrame,2);

	}

	else{

		subtotalHQFrame="";		

	}

document.getElementById("hqFramesSubTotalDis[]").value=subtotalHQFrame;		

document.getElementById("hqst").innerHTML=subtotalHQFrame;		

	}

	

function stopCalHQframe(){

  clearInterval(intervalHQframe);

  //clearInterval(interval2);

  

}



//-------------------Check Quantity-----------------	



function quantitycheckHQframe1(){

var q=document.getElementById("hqFrameQuantity[]").value;



if(q==""){

alert("PLEASE ENTER QUANTITY")	

	}	

	}

	

function quantitycheckHQframe2(){
var getTable3 = document.getElementById('HQFrames');
var countRow3 = getTable3.rows.length;
var iteration=countRow3-2;

var qId="hqFrameQuantity["+iteration+"]";

var q=document.getElementById(qId).value;



if(q==""){

alert("PLEASE ENTER QUANTITY")	

	}	

	}

	

	

	