 shq.Regular={
  '1-2':{dollars:0,Hours:0},
  '2-3':{dollars:0,Hours:0},
  '3-4':{dollars:0,Hours:0},
  '4-5':{dollars:0,Hours:0},
  '5-6':{dollars:0.6,Hours:0},
  '6-7':{dollars:0.6,Hours:0},
  '7-8':{dollars:0.6,Hours:0},
  '8-9':{dollars:0.6,Hours:1},
  '9-10':{dollars:0.,Hours:1},
  '10-11':{dollars:1,Hours:1},
  '11-12':{dollars:1,Hours:1},
  '12-13':{dollars:1,Hours:1},
  '13-14':{dollars:1,Hours:1},
  '14-15':{dollars:1,Hours:1},
  '15-16':{dollars:1.1,Hours:2},
  '16-17':{dollars:1.1,Hours:2},
  '17-18':{dollars:1.1,Hours:2},
  '18-19':{dollars:1.1,Hours:2},
  '19-20':{dollars:1.1,Hours:2},
  '20-21':{dollars:1.1,Hours:2},
  '21-22':{dollars:1.1,Hours:2},
  '22-23':{dollars:1.1,Hours:2},
  '23-24':{dollars:1.4,Hours:3},
  '24-25':{dollars:1.4,Hours:3},
  '25-26':{dollars:1.6,Hours:3},
  '26-27':{dollars:1.6,Hours:3},
  '27-28':{dollars:1.6,Hours:3},
  '28-29':{dollars:1.6,Hours:3},
  '29-30':{dollars:1.6,Hours:3},
  '30-31':{dollars:1.8,Hours:4},
  '31-32':{dollars:1.8,Hours:4},
  '32-33':{dollars:1.8,Hours:4},
  '33-34':{dollars:1.8,Hours:4},
  '34-35':{dollars:1.8,Hours:4},
  '35-36':{dollars:2,Hours:5},
  '36-37':{dollars:2,Hours:5},
  '37-38':{dollars:2,Hours:5},
  '38-39':{dollars:2.2,Hours:5},
  '39-40':{dollars:2.2,Hours:6},
  '40-41':{dollars:2.5,Hours:6},
  '41-42':{dollars:2.5,Hours:6},
  '42-43':{dollars:2.8,Hours:6},
  '43-44':{dollars:2.8,Hours:7},
  '44-45':{dollars:3,Hours:7},
  '45-46':{dollars:3,Hours:7},
  '46-47':{dollars:3,Hours:8},
  '47-48':{dollars:3.5,Hours:8},
  '48-49':{dollars:3.5,Hours:8},
  '49-50':{dollars:3.5,Hours:9},
  '50-51':{dollars:3.5,Hours:9},
  '51-52':{dollars:3.5,Hours:9},
  '52-53':{dollars:3.6,Hours:9},
  '53-54':{dollars:3.9,Hours:9},
  '54-55':{dollars:3.9,Hours:10},
  '55-56':{dollars:3.9,Hours:10},
  '56-57':{dollars:4,Hours:10},
  '57-58':{dollars:4.1,Hours:10},
  '58-59':{dollars:4.2,Hours:12},
  '59-60':{dollars:4.3,Hours:12},
  '60-61':{dollars:8,Hours:14},
  '61-62':{dollars:8.5,Hours:15},
  '62-63':{dollars:9,Hours:16},
  '63-64':{dollars:9.5,Hours:17},
  '64-65':{dollars:9.8,Hours:18},
  '65-66':{dollars:10,Hours:19},
  '66-67':{dollars:10.4,Hours:20},
  '67-68':{dollars:10.8,Hours:21},
  '68-69':{dollars:11.5,Hours:22},
  '69-70':{dollars:12,Hours:23},

  '1-20':{dollars:12.9,Hours:24},
  '1-30':{dollars:28.99,Hours:72},
  '1-40':{dollars:59.99,Hours:120},
  '1-50':{dollars:88.99,Hours:192}
  }
shq.Regular.ItemName='WOW Level up';
shq.Regular.ItemCount=1;
shq.Regular.Price=0;
shq.Regular.TotalPrice=0;
shq.Regular.requirements='';

shq.Regular.estimate=function()
{
/*
var startlevel=shq.$('startlevel'),Desiredlevel=shq.$('Desiredlevel');
  if(!startlevel.value.IsNumeric()||startlevel.value>70){shq.WriteDefaultValue.call(startlevel);return;}
  if(!Desiredlevel.value.IsNumeric()||Desiredlevel.value>70){shq.WriteDefaultValue.call(Desiredlevel);return;}
  var price=0,hours=0;
var total=function t(s,d)
	{
	  if(s==71||s==d){return {Price:price,Hours:hours}}else{
	  price+=shq.Regular[s+'-'+(s+1)].dollars;
	  hours+=shq.Regular[s+'-'+(s+1)].Hours;
      return t(s-0+1,d)
	  }
	}
try{
  shq.$('Price').value=shq.Regular[startlevel.value+'-'+Desiredlevel.value].dollars;
  shq.$('Circatime').value=shq.Regular[startlevel.value+'-'+Desiredlevel.value].Hours;
  }catch(e){
  var Total=total(startlevel.value-0,Desiredlevel.value-0);
    shq.$('Price').value=Total.Price.toFixed(2);
    shq.$('Circatime').value=Total.Hours;
  }
  
  var Total=total(startlevel.value-0+1,Desiredlevel.value-0+1);
  shq.$('Price').value=Total.Price.toFixed(2);
  shq.$('Circatime').value=Total.Hours;
  */

  var xhr=new XMLHttpRequest();
           xhr.open("get","get.asp?do=getpowerlevel&startlevel="+shq.$('startlevel').value+"&endlevel="+shq.$('Desiredlevel').value+"&game=gold",true)	
       var processReqChange=function(){	
	   if(xhr.readyState==4)
		{
		 if (xhr.status == 200){
			 /*
			 eval(xhr.responseText);
	 document.getElementById('level_price').value=((document.getElementById('level_price').value-0)*0.95).toFixed(2)
			*/
			 
           var result=xhr.responseText.split(/\n/);
	
    document.getElementById('level_time').value=result[1];
    
	document.getElementById('level_price').value=((result[0]-0)*0.95).toFixed(2)
    
        } else {
            alert("There was a problem retrieving the XML data:\n" +
                xhr.statusText);
			
		}
	   }
      }
      xhr.onreadystatechange=processReqChange;
      xhr.send(null);
}
shq.Regular.post=function()
{    
	 var Price=shq.$('level_price').value;
	 var Hours=shq.$('level_time').value;
	 var reg_form=shq.$('reg_form');
	 if(Price==0||Price<1){return false;}
     shq.$('footfrm').innerHTML=shq.formHtml;
	  var newfrm=shq.$('footfrm').getElementsByTagName('form')[0]
	   newfrm.ItemName.value=shq.Regular.ItemName+'('+shq.$('startlevel').value+'-'+shq.$('Desiredlevel').value+')('+Hours+' days)';
	  newfrm.ItemCount.value=shq.Regular.ItemCount;
	  newfrm.Price.value=Price
	  newfrm.TotalPrice.value=Price
	  newfrm.requirements.value='';
	  
	  newfrm.action=reg_form.action;
	  
	  newfrm.method=reg_form.method;
	  if(Price>14){
	  newfrm.submit();
	  return false}
	  else{
	  alert('Minimum order is $ 14')
	  return false;
	  
	  }
	  
	   
    
}
shq.Regular.form_event=function()
{
	shq.Events.add(shq.$('startlevel'),'click',shq.CleanDefaultValue);
	shq.Events.add(shq.$('Desiredlevel'),'click',shq.CleanDefaultValue);
}

shq.runOnload(shq.Regular.form_event);