// function RedirRegion(ddlRegions)
//{
//	window.location = "bin_hire.aspx?rid=" + ddlRegions.options[ddlRegions.selectedIndex].value;
//}

//function RedirPCs(rid, ddlPCs)
//{
//	window.location = "bin_hire.aspx?rid=" + rid + "&pcid=" + ddlPCs.options[ddlPCs.selectedIndex].value;
//}

function RedirWasteType(pc, ddlWasteTypes)
{
	var j = Form1.ddlWasteTypes.length;
	//alert(j);
	if(typeof j == "undefined")
	{
		//alert('here');
		var wtid = Form1.ddlWasteTypes.value;
	}
	else
	{
		for (i=0; i<j; i++)
		{
			if(Form1.ddlWasteTypes[i].checked) 
			var wtid = Form1.ddlWasteTypes[i].value;
		}	
	}
	//alert(wtid);
	window.location = "skip_bins_" + pc + "_" + wtid + ".aspx#size";
}

function RedirWasteType_DEMO(pc, ddlWasteTypes)
{
	var j = Form1.ddlWasteTypes.length;
	//alert(j);
	if(typeof j == "undefined")
	{
		//alert('here');
		var wtid = Form1.ddlWasteTypes.value;
	}
	else
	{
		for (i=0; i<j; i++)
		{
			if(Form1.ddlWasteTypes[i].checked) 
			var wtid = Form1.ddlWasteTypes[i].value;
		}	
	}
	//alert(wtid);
	window.location = "skipbin_process_demo.aspx?pc=" + pc + "&wtid=" + wtid;
}

function CalcPCString(theForm)
{
	var strPC = "";
	for (var i = 1; i < theForm.length; i ++)
	{
		if(theForm.elements[i].checked == true)
		{
			strPC = strPC + document.getElementById(theForm.elements[i].name).value + ",";
		}
	}
	//alert(strPC);
}


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}


//DHTML function for FAQs
function toggle(object) {
	//alert(object);
  if (document.getElementById) {
	//alert(object);
    if (document.getElementById(object).style.display == 'block')
		//alert('This one')
      //document.getElementById(object).style.position = 'absolute';
      document.getElementById(object).style.display = 'none';
    else
		//alert('no This one')
      //document.getElementById(object).style.position = 'relative';
      document.getElementById(object).style.display = 'block';
  }

  else if (document.layers && document.layers[object] != null) {
  //alert(object);
    if (document.layers[object].display == 'block' ||
        document.layers[object].display == 'block' )
      document.layers[object].display = 'none';
    else
      document.layers[object].display = 'block';
  }

  else if (document.all) {
    if (document.all[object].style.display == 'block')
      document.all[object].style.display = 'none';
    else
      document.all[object].style.display = 'block';
  }
}

function Popup(title, url, height, width, left, top) {
//alert('here')
properties = "title=0,toolbar=0,location=0,scrollbars=1,height=" + height;
properties = properties + ",width=" + width;
properties = properties + ",left=" + left + ",top=" + top;
popupHandle = open(url, title, properties);
} 

function checkTerms(theform){
		if(theform.terms.checked) 
		{
			return true;
		}
		else
		{
			alert('To proceed to the secure bookings page you must check the I Agree checkbox.')
			return false;
		}
}
	
function checkModel(objSource, objArgs){
	var blnValid = true;
	var IntNumber = objArgs.Value;
	if (IntNumber == 0)
		{
			blnValid = false
		}
	else
		{
			blnValid = true
		}
	objArgs.IsValid = blnValid
	return;
}

function valNumber(theinput){
	if(isNaN(theinput.value) || (theinput.value == "") || (theinput.value.indexOf(".") > -1))
		{
			theinput.value = 0;
			alert('You have just entered and invalid number.');
			theinput.select();
			theinput.focus();
		}
	else
		{
			if (theinput.value < 0 || theinput.value > 9999)
				{
					theinput.value = 0;
					alert('You have just entered and invalid number.');
					theinput.select();
					theinput.focus();
				}
		}
}

function TimeIt(){
	setTimeout("ScrollIt()", 500);
}

function ScrollIt(){
	window.scrollTo(0,300);
}


function SelectChk(Select)
	{    
		for (var n=16; n < document.forms[0].length; n++)        
			if (document.forms[0].elements[n].type=='checkbox')            
			document.forms[0].elements[n].checked=Select;    
		return false;   
	}
	
	
	