function pop(h,b) {
  document.getElementById('mainDiv').style.display='block';
  document.getElementById('popuptitle1').innerHTML=h;
  document.getElementById('popupbody1').innerHTML=b;
  return false
  
 
  
}
 
 function popwindow(h,d1,d2,val)
{
	
	
		var width = 700;
		var height = 900;
	
    var left = parseInt((screen.availWidth/2) - (width/2));
    var top = parseInt((screen.availHeight/2) - (height/2));
    var windowFeatures = "width=" + width + ",height=" + height ;
	
    windowFeatures=windowFeatures+",left=" + left + ",top=" + top + "screenX=" + left + ",screenY="+    top;
    windowFeatures=windowFeatures+"toolbar=0,status=0";
	openbox(h,d1,d2,val);
/*retval=window.showModalDialog("popupwindow.php?head="+h+"&discription="+b,'Mail',windowFeatures);*/
//retval=window.open("popupwindow.php?head="+h+"&discription="+b,'Mail',windowFeatures);
/*if(retval!=null)
{
	        retval_array = retval.split(",");
			   name=retval_array[0];
			  phone=retval_array[1];
			  email=retval_array[2];
			
window.open("http://www.installxpress.co.uk?nm="+name+"&pn="+phone+"&em="+email,'_self',true);
}*/
}
/*function pop1() {
  document.getElementById('mainDiv1').style.display='block';
   document.getElementById('mainDiv').style.display='none';
  return false
}*/
function hide() {
  document.getElementById('mainDiv').style.display='none';
  //document.getElementById('mainDiv1').style.display='none';
  return false
}
function homewindow() {
	
 name=document.getElementById('txtname').value;
 phone=document.getElementById('txtphone').value;
   email=document.getElementById('txtemail').value;
   if(document.getElementById('txtname').value=="")
		{
			alert("Please Enter Your Name");
			document.getElementById('txtname').focus();
			return false;
		}  
		
		 if(document.getElementById('txtphone').value=="")
		{
			alert("Please Enter Your  Phone Number");
			document.getElementById('txtphone').focus();
			return false;
		}

		 if(document.getElementById('txtemail').value=="")
		{
			alert("Please Enter Your  EmailId");
			document.getElementById('txtemail').focus();
			return false;
		}		
		if(document.getElementById('txtemail').value)
		{  
		    
		    src=document.getElementById('txtemail').value;
			//var emailReg = "^[\\w-_\.+]*[\\w-_\.]\@([\\w]+\\.)+[\\w]+[\\w]$";
	        var emailReg=".+@.+\\.[a-z]+";
            var regex = new RegExp(emailReg);			
          
			if(!regex.test(src))
			{
				alert("Please Enter Valid  Email ID");			
				return false;		
			}
		
	    }
		
			
		
  window.open("http://www.installexpress.co.uk?nm="+name+"&pn="+phone+"&em="+email,'_self',true);
    return true
		
}

intialprice=0;
function pricechanging(val)
{
var popupboxtv = false;
var popupboxcinema = false;
price=0;
obj=val;
selIdx =  document.getElementById("attrib-17").selectedIndex;
                            newSel =  document.getElementById("attrib-17").options[selIdx].text;
							 newSel1 =  document.getElementById("attrib-17").options[selIdx].value;
//hidding by aneesh for the reson mentioned on 325
 //if(document.getElementById("attrib-4-34").checked==true)
			             //    {
							
						//	if(newSel!="18:00" && newSel!="19:00" && newSel!="20:00" && newSel!="21:00")
						//	{
						//	document.getElementById("attrib-17").options.length=0;
						//	document.getElementById("attrib-17").options[0]=new Option("18:00", "78", true, false);
						//	document.getElementById("attrib-17").options[1]=new Option("19:00", "79", false, false);
						//	document.getElementById("attrib-17").options[2]=new Option("20:00", "80", false, false);
						//	document.getElementById("attrib-17").options[3]=new Option("21:00", "81", false, false);
						//	}
							 
							
						//	 }
//else 
	//{
								
							if(newSel!="09:00" && newSel!="10:00" && newSel!="11:00"&& newSel!="12:00"&& newSel!="13:00"&& newSel!="14:00"&& newSel!="15:00"&& newSel!="16:00"&& newSel!="17:00")
							{	
		                    document.getElementById("attrib-17").options.length=0;
							document.getElementById("attrib-17").options[0]=new Option("09:00", "69", true, false);
							document.getElementById("attrib-17").options[1]=new Option("10:00", "70", false, false);
							document.getElementById("attrib-17").options[2]=new Option("11:00", "71", false, false);
							document.getElementById("attrib-17").options[3]=new Option("12:00", "72", false, false);
							document.getElementById("attrib-17").options[4]=new Option("13:00", "73", false, false);
							document.getElementById("attrib-17").options[5]=new Option("14:00", "74", false, false);
							document.getElementById("attrib-17").options[6]=new Option("15:00", "75", false, false);
							document.getElementById("attrib-17").options[7]=new Option("16:00", "76", false, false);
							document.getElementById("attrib-17").options[8]=new Option("17:00", "77", false, false);
							//document.getElementById("attrib-17").options[9]=new Option("18:00", "78", false, false);
							}
							else
							{
								document.getElementById("attrib-17").options.length=0;
							document.getElementById("attrib-17").options[0]=new Option("09:00", "69", true, false);
							document.getElementById("attrib-17").options[1]=new Option("10:00", "70", false, false);
							document.getElementById("attrib-17").options[2]=new Option("11:00", "71", false, false);
							document.getElementById("attrib-17").options[3]=new Option("12:00", "72", false, false);
							document.getElementById("attrib-17").options[4]=new Option("13:00", "73", false, false);
							document.getElementById("attrib-17").options[5]=new Option("14:00", "74", false, false);
							document.getElementById("attrib-17").options[6]=new Option("15:00", "75", false, false);
							document.getElementById("attrib-17").options[7]=new Option("16:00", "76", false, false);
							document.getElementById("attrib-17").options[8]=new Option("17:00", "77", false, false);
							//document.getElementById("attrib-17").options[9]=new Option("18:00", "78", false, false);
							}
							document.getElementById("attrib-17").selectedIndex=selIdx;
							
	//}				

x=document.getElementsByTagName("input");
for(i=0;i<x.length;i++)
{
 if( x[i].checked==true && (x[i].type=="radio" || x[i].type=="checkbox"))
 {
  if(((val.id)!="attrib-8-33") && ((val.id)!="attrib-13-59"))
  {
   constant=x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[0].innerHTML;
   if(constant!="None" && constant!="Standard")
    {
		if(x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3]!=null)
		{
     price1=x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3].innerHTML;
     price+=parseFloat(price1.substr(1));
		}

	        if((val.id)=="attrib-4-10")
			{
				
				 popwindow("Next Day Installation","Do you have a cavity in the wall where the TV will be mounted?","Please enter your information to have one of our agents contact you to arrange your installation",obj);	   
				 //popwindow("Wall cabling","<div id='boxtitle'><input type='text' name='txtname' id='txtname' value=''/></div>",obj);
              changediv();
			}
    }
  }
  else
  {
  
   //for increasing price
		//price1=x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3].innerHTML;
     //price+=parseFloat(price1.substr(1));
  
//onmouseover="popupWindow('popup1',event,h1,b1,true);" onmouseout="popupWindow('popup1',event,h1,b1,false);" onclick="clickWindow(h1,b1)"
	  //popupWindow('popup1',event,"test","test",true);
	  	//document.getElementById("attrib-8-33").onclick=clickWindow("testing","Testing");
		//popup1="popup1";
		values=new Array();
		values[0]="Wall cabling";
		values[2]='"Please enter your information to have one of our agents contact you to arrange your installation"<br><div align="center" id="divinp2" class="passwordpos">Name&nbsp;<input type="Textbox" name="txtname" id="txtname"><br><br>Phone&nbsp;<input type="Textbox" name="txtphone" id="txtphone" onKeyPress="return validateamount(event);"><br><br>Email&nbsp;<input type="Textbox" name="txtemail" id="txtemail"><br></div><br><div align="center"><input type="button" value="Submit" onclick="homewindow()";><input type="hidden" name="bsubmit" ;>&nbsp;&nbsp;<input type="button" value="Quit" onclick="return hide()";><br></div>'
		values[1]='"Do you have a cavity in the wall where the TV will be mounted?"<br><div align="center"><input type="button" value="yes" onClick="return hide();;">&nbsp;&nbsp;<input type="button" value="No" onClick="return pop(values[0],values[2])";></div>';
		//popupWindow('popup1',values[0],values[1],true);*/
		if((val.id)=="attrib-8-33")
		{
		if(x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3]!=null)
			{
		 price1=x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3].innerHTML;
		 
         price+=parseFloat(price1.substr(1));
			}
    
		popupboxtv=true;
		}
		if((val.id)=="attrib-13-59")
		{
			if(x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3]!=null)
			{
		 price1=x[i].parentNode.parentNode.childNodes[0].childNodes[0].childNodes[3].innerHTML;
		 
         price+=parseFloat(price1.substr(1));
			}
		popupboxcinema=true;
		}
		
         
			 //
		
		/* price+=parseFloat(price1.substr(1));*/
		
	/*	pop(values[0],values[1]);*/
	
		
  }
 }
}

    if(popupboxtv)
     {
     popwindow("Wall cabling","Do you have a cavity in the wall where the TV will be mounted?","Please enter your information to have one of our agents contact you to arrange your installation",obj);
     }
    else if(popupboxcinema)
     {
	 popwindow("Wall cabling/Concealing","Do you want to continue with, Wall cabling/concealing in home cinema installation package?","Please enter your information to have one of our agents contact you to arrange your installation",obj);	 
     }
   
   //popup=document.getElementById("attrib-8-33");
   //if(popup.checked==true)
   // popup.parentNode.parentNode.parentNode.innerHTML+="<tr><td colspan='2'>test</td></tr>";
   
   //hidded for select
sel=document.getElementsByTagName("select");
//alert(sel.length);
for(l=2;l<sel.length;l++)
{

selindex=sel[l].parentNode.childNodes[0].selectedIndex;

selvalue=sel[l].parentNode.childNodes[0].options[selindex].text;
	if(selvalue.indexOf(".")!=-1 && selvalue.lastIndexOf(")")!=-1)
	{
	price+=parseFloat(selvalue.substr(selvalue.lastIndexOf("(")+2,(selvalue.lastIndexOf(")")+3)));												 
	}
																								  
}


if(intialprice==0)
{
intialprice=document.getElementById("btn1").value;
currentprice=parseFloat(intialprice.substr(1));
}

actualprice=currentprice+price;

actualprice='£'+actualprice;
actualprice=actualprice.substr(1);

if(actualprice.indexOf(".")!=-1)
{
actualprice=actualprice.substr(0,actualprice.indexOf(".")+3);
}

document.getElementById("btn1").value=actualprice;
document.getElementById("btn2").value=actualprice;
  //print("%.2f" % round(a,2))



//actualprice
/*  a=13.946
  print(a)
  13.946
  print("%.2f" % a)
  13.95
  round(a,2)
  13.949999999999999
  print("%.2f" % round(a,2))
  13.95*/


}




//function popupWindow8(o,h,b,d)
//      {
//        
//		document.getElementById('popup1').style.top=500+"px";
//		document.getElementById('popup1').style.left=500+"px";
//		document.getElementById('popuptitle1').innerHTML=h;
//		document.getElementById('popupbody1').innerHTML=b;
//        var obj = document.getElementById(o);
//        if(d)
//          obj.style.display = 'block';
//		  //document.getElementById('popup1').style.top=500+"px";
//        else
//          obj.style.display = 'none';
//      }

//for date display start

// if(document.getElementById("attrib-4-10").checked==false)
if(document.getElementById("datevar1"))
{

val1=document.getElementById("datevar1").value;
val2=document.getElementById("datevar2").value;
val3=document.getElementById("datevar3").value;
val1 -= 1;

/* the bottom portion hidden by aneesh..why because the timing options are hidded by the admin and also index page removed the timing option*/
/*var myDate=new Date(val3,val1,val2);

var myday = new Date();
myday.setDate(myday.getDate()+1);
if(myDate.getMonth()==myday.getMonth() && myDate.getFullYear()==myday.getFullYear() && myDate.getDate()==myday.getDate())
document.getElementById("attrib-4-10").checked=true;
else if((myDate.getDay()==0 || myDate.getDay()==6) && (myDate.setDate(myDate.getDate()))>(myday.setDate(myday.getDate())))
document.getElementById("attrib-4-11").checked=true;
else
document.getElementById("attrib-4-15").checked=true;
*/
var value='';
pricechanging(value);
}
//in onload increse the width of one select box;
if(document.getElementById("attrib-10"))
{
document.getElementById("attrib-10").style.width="230px";
}
if(document.getElementById("attrib-12"))
{
document.getElementById("attrib-12").style.width="170px";
}
if(document.getElementById("attrib-15"))
{
document.getElementById("attrib-15").style.width="210px";
}
if(document.getElementById("attrib-14"))
{
document.getElementById("attrib-14").style.width="205px";
}
if(document.getElementById("attrib-11"))
{
document.getElementById("attrib-11").style.width="205px";
}

if(document.getElementById("attribb-10"))
	{	


//if(document.getElementById("pophead3").innerHTML=="Cabling")
//{
	
	document.getElementById("attribb-10").style.cursor="pointer";
	document.getElementById("attribb-10").innerHTML=document.getElementById("attribb-10").innerHTML+ "<img src='../images/question.jpg'> "
	//document.getElementById("pophead3").setAttribute('onclick', 'cable(this)');
	document.getElementById("attribb-10").onclick=function()
	{
		typeofwall(this);
	}

//}
	}

/*if(document.getElementById("pophead1").innerHTML.match("Cables (Length and quantity)"))
{

	document.getElementById("pophead1").style.cursor="pointer";
	document.getElementById("pophead1").innerHTML=document.getElementById("pophead1").innerHTML+"<img src='../images/question.jpg'> "
	//document.getElementById("pophead3").setAttribute('onclick', 'cable(this)');
	document.getElementById("pophead1").onclick=function()
	{
		cableslength(this);
	}

}
*/


if(document.getElementById("pophead3"))
	{	


if(document.getElementById("pophead3").innerHTML.match("Cabling options"))
{

	document.getElementById("pophead3").style.cursor="pointer";
	document.getElementById("pophead3").innerHTML=document.getElementById("pophead3").innerHTML+"<img src='../images/question.jpg'> "
	//document.getElementById("pophead3").setAttribute('onclick', 'cable(this)');
	document.getElementById("pophead3").onclick=function()
	{
		cable(this);
	}

}
	}
	
if(document.getElementById("attrib-16-0"))
	{	


//if(document.getElementById("pophead3").innerHTML=="Cabling")
//{
	
	document.getElementById("attrib-16-0").style.cursor="pointer";
	document.getElementById("attrib-16-0").innerHTML=document.getElementById("attrib-16-0").innerHTML+ "<img src='../images/question.jpg'> "
	//document.getElementById("pophead3").setAttribute('onclick', 'cable(this)');
	document.getElementById("attrib-16-0").onclick=function()
	{
		datetimes(this);
	}

//}
	}	
	
	/*if(document.getElementById("pophead4"))
	{
if(document.getElementById("pophead4").childNodes[0].childNodes[0].innerHTML=="Cables (Length and quantity)")
{
	document.getElementById("pophead4").style.cursor="pointer";
	document.getElementById("pophead4").innerHTML="Cables (Length and quantity)<img src='../images/question.jpg'> "
	document.getElementById("pophead4").onclick=function()
	{
		cableslength(this);
	}
	
}
	}*/
		if(document.getElementById("attribb-9"))
	{
	


	document.getElementById("attribb-9").style.cursor="pointer";
	document.getElementById("attribb-9").innerHTML=document.getElementById("attribb-9").innerHTML+"<img src='../images/question.jpg'> ";
	document.getElementById("attribb-9").onclick=function()
	{
		cableslength(this);
	}
				 

	
}
	
if((document.getElementById("pophead1").innerHTML).indexOf("Wall bracket options")!=-1)
	{
	document.getElementById("pophead1").style.cursor="pointer";
	document.getElementById("pophead1").innerHTML=document.getElementById("pophead1").innerHTML+"<img src='../images/question.jpg'> ";
	document.getElementById("pophead1").onclick=function()
	{
		bracketoptions(this);
	}
				 

	
}
//function bracketoptions(obj)
//{
	//popwindow("Wall bracket options","We can supply you with a fantastic range of great value wall brackets. Generally we recommend the fixed bracket. However if the TV is being mounted more than 6 feet high, consider the tilting bracket. For those needing to allow for obstructions we recommend our cantilever (tilt & swivel) bracket.","cab",obj);
//}
function bracketoptions(obj)
{
	popwindow("Wall bracket options","<b>Fixed Brackets</b><br><br>Those looking for a great looking and simple wall mounting should go for a fixed bracket. These have a profile of only 25mm from the wall and are the most sturdy and reliable wall brackets.<br /><br /><br /><b>Tilting brackets</b><br><br>These are to be avoided for the following reasons<br><b>1.</b> New TVs offer a near 180 degree viewing angle which won't be improved by the 15 degree tilt most of these brackets offer.<br><b>2. </b>The tilting mechanism makes the profile of the brackets bigger. As a rule, the further the TV is from the wall, the worse it looks.<br><b>3.</b> Many tilting mechanisms are incapable of holding the weight recommended by the manufacturer, as such the TV is left in the 'down' tilt setting permanently.<br /><br /><br /><b>Cantilever Brackets</b><br><br>If you have an unusual room layout or for any other reason you feel you need a pull out and swivel bracket, we recommend 2 depending on the size. The Vogels bracket we recommend is the VFW 8325, this is a top of the range bracket with a low profile and a lifetime warranty. If your TV is larger than 50\" please call us for alternate options.<br /><br /><br /><b>Can we get our own bracket?</b><br><br>Absolutely! Although we offer unbeatable value on our packages with brackets you may decide to get your own. Just one piece of advice. Many of the large retailers utilise 'bracket finders' on their websites. These invite you to put your make and model etc. of TV and they will show you a selection of brackets that fit your TV. Unfortunately we have had hundreds of customers who have followed this advice to learn that the VESA (mounting plate) is the wrong size or the bracket can't accommodate the right size screws for the TV etc. Please note that many of these online retailers refuse returns on these grounds so check the small print. All of the brackets we use at Install Express are guaranteed to work on all TVs of the appropriate size.","cab8",obj);
}
//"<b>Fixed Brackets<b><br><br>For those looking for a great looking and simple wall mounting should go for the fixed bracket. These have a profile of only 25mm from the wall and are the most sturdy and reliable wall brackets.<br><br><b>Tilting brackets</b><br><br>These are to be avoided for the following reasons<br><b>1.</b> New TVs offer a near 180 degree viewing angle which won't be improved by the 15 degree tilt most of these brackets offer.<br><b>2.</b> The tilting mechanism makes the profile of the brackets bigger. As a rule, the further the TV is from the wall, the worse it looks.<br><b>3.</b> Many tilting mechanisms are incapable of holding the weight recommended by the manufacturer, as such the TV is left in the 'down' tilt setting permanently.<br><br><b>Cantilever Brackets</b><br><br>If you have an unusual room layout or for any other reason you feel you need a pull out and swivel bracket, we recommend 2 depending on the size. The Vogels bracket we recommend is the VFW 8325, this is a top of the range bracket with a low profile and a lifetime warranty. If your TV is larger than 50\" please call us for alternate options.<br><br><b>Can we get out own bracket?</b><br><br>Absolutely! Although we offer unbeatable value on our packages with brackets you may decide to get your own. Just one piece of advice. Many of the large retailers utilise 'bracket finders' on their websites. These invite you to put your make and model etc. of TV and they will show you a selection of brackets that fit your TV. Unfortunately we have had hundreds of customers who have followed this advice to learn that the VESA (mounting plate) is the wrong size or the bracket can't accommodate the right size screws for the TV etc. Please note that many of these online retailers refuse returns on these grounds so check the small print. All of the brackets we use at Install Express are guaranteed to work on all TVs of the appropriate size."
function cable(obj)
{
	popwindow("Cabling","<table border=0 celpadding=0 cellspacing=0 height=120 width=300 ><tr align=left><td width='50%' style='padding:5px 10px 5px 0;' valign=top><b>Normal cabling</b><br><div align=left>We will conceal your cables with top quality D-Line semi-circular trunking (up to 1.5m) from your TV down to your components. The trunking comes in white or silver and is hinged and easily paintable.</div></td><td style='padding:5px 5px 5px 5px ;' valign=top><b>In wall cabling</b><br><div align=left>If you have a cavity wide enough, we can run the cables inside the wall, we will finish off the hole with a brush plate to leave everything looking tidy.</div></td></tr></table>","cab5",obj);
}


function typeofwall(obj)
{
	popwindow("Type of Wall","For certain walls (i.e. brick, concrete) we suggest using heavy duty mounting bolts for a more secure installation, please select your wall type below.","cab1",obj);
}


function cableslength(obj)
{
	popwindow("Cables (Length and quantity)","Don't worry about what cables to choose, we bring most lengths and cables with us and we'll only use them if we can't use the ones you've got already! ","cab1",obj);
}
//for date display end	
function datetimes(obj)
{
	popwindow("Installation Date & Time","Please select your preferred date and time, we will try to get as close as possible! If we can't make that time exactly we will call you shortly after your order is submitted to discuss other time slots ","cab4",obj);
}

  function validateamount(evt)
  {
    var charCode = (evt.which) ? evt.which : evt.keyCode
		
         if (charCode >=48 && charCode <= 57 || charCode == 8|| charCode ==46|| charCode ==9|| charCode ==11)
		 {
			  
           return true;
		 }
		   
	return false;
  }
function gradient(id, level)
{
	var box = document.getElementById(id);
	box.style.opacity = level;
	box.style.MozOpacity = level;
	box.style.KhtmlOpacity = level;
	box.style.filter = "alpha(opacity=" + level * 100 + ")";
	box.style.display="block";
	return;
}


function fadein(id) 
{
	var level = 0;
	while(level <= 1)
	{
		setTimeout( "gradient('" + id + "'," + level + ")", (level* 1000) + 10);
		level += 0.01;
	}
}


// Open the lightbox


function openbox(h,d1,d2,self)
{
	 Xwidth = self.offsetHeight;
  Yheight = self.offsetWidth;

	var scrolledX, scrolledY;
if( self.pageYOffset ) {
scrolledX = self.pageXOffset;
scrolledY = self.pageYOffset;
} else if( document.documentElement && document.documentElement.scrollTop ) {
scrolledX = document.documentElement.scrollLeft;
scrolledY = document.documentElement.scrollTop;
} else if( document.body ) {
scrolledX = document.body.scrollLeft;
scrolledY = document.body.scrollTop;
}

// Next, determine the coordinates of the center of browser's window

var centerX, centerY;
if( self.innerHeight ) {
centerX = self.innerWidth;
centerY = self.innerHeight;
} else if( document.documentElement && document.documentElement.clientHeight ) {
centerX = document.documentElement.clientWidth;
centerY = document.documentElement.clientHeight;
} else if( document.body ) {
centerX = document.body.clientWidth;
centerY = document.body.clientHeight;
}

// Xwidth is the width of the div, Yheight is the height of the
// div passed as arguments to the function:
var leftOffset = scrolledX + (centerX - Xwidth) / 2;
var topOffset = scrolledY + (centerY - Yheight) / 2;
// The initial width and height of the div can be set in the
// style sheet with display:none; divid is passed as an argument to // the function
var o=document.getElementById("box");
var r=o.style;
r.position='absolute';
r.top = topOffset-100 + 'px';
if(d2=="cab6")
{
r.left = leftOffset-70 + 'px';
}
if(d2=="cab7")
{
     r.left = (screen.width/2)-(550/2)-100+'px';
     r.top = '500px';
     
}
if(d2=="cab9")
{
     r.left = (screen.width/2)-(550/2)-100+'px';
     r.top = (screen.height/2)-(750/2)+'px';
}
else
{
r.left = leftOffset-200 + 'px';
}
r.display = "block"; 
  
	
	
  var box = document.getElementById('box');
     if(d2=="cab2")
   {
	   d2="Please enter your information to have one of our agents will contact you soon";
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';   
	document.getElementById("box").style.height="170px";
	document.getElementById("x1").style.cursor="pointer";
	document.getElementById("x2").style.cursor="pointer";
     document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";
   }
   else if(d2=="cab1")
   {
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';   
	document.getElementById("box").style.height="100px";
     document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";
   }
   else if(d2=="cab")
   {
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';   
	document.getElementById("box").style.height="150px";
     document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";
   }
    else if (d2=="cab3")
   {
	   d2="Please enter your information to have one of our agents contact you to arrange your installation";
  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
  document.getElementById('but1').innerHTML='<input type="button" id="btnyes" name="btnyes"  onClick="closebox();" class="yesbtn"/>';
  document.getElementById('but2').innerHTML='<input type="button" id="btnno" name="btnno"  onClick="changediv();"  class="nobtn"/>';
  document.getElementById('filter').style.display='block';
  document.getElementById("box").style.height="100px";
   document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";
   }
   else if(d2=="cab4")
   {
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';   
	document.getElementById("box").style.height="115px";
     document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";
   }
    else if(d2=="cab5")
   {
	   //d2="Please enter your information to have one of our agents contact you to arrange your installation";
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';   
	document.getElementById("box").style.height="210px";
    document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";

   }
   else if(d2=="cab6")
   {
	   //d2="Please enter your information to have one of our agents contact you to arrange your installation";
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML='<img src="'+d1+'" width=350 height=300>';
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';
	document.getElementById("box").style.height="350px";
	 document.getElementById("box").style.width="405px";
    document.getElementById('boxtitle').style.width="425px";

   }
        else if(d2=="cab7")
   {
	   //d2="Please enter your information to have one of our agents contact you to arrange your installation";
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML='<img src="'+d1+'" width=696 height=448>';
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';
	document.getElementById("box").style.height="500px";
    document.getElementById("box").style.width="750px";
    document.getElementById('boxtitle').style.width="770px";


   }
   else if(d2=="cab8")
   {
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';
	document.getElementById("box").style.height="530px";
    document.getElementById("box").style.width="750px";
     document.getElementById('boxtitle').style.width="770px";
     document.getElementById('description1').style.width="680px";
     //alert(parseInt(r.left)-150)+'px';
     r.left = (parseInt(r.left)-160)+'px';
   }
           else if(d2=="cab9")
   {
	   //d2="Please enter your information to have one of our agents contact you to arrange your installation";
	  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML='<img src="'+d1+'" width=696 height=448>';
  document.getElementById('description2').innerHTML=d2;
    document.getElementById('but1').innerHTML='';
  document.getElementById('but2').innerHTML='<input type="button"  onClick="closebox();" class="quitbtn">&nbsp;&nbsp;&nbsp;&nbsp;';
  document.getElementById('filter').style.display='block';
	document.getElementById("box").style.height="500px";
    document.getElementById("box").style.width="750px";
    document.getElementById('boxtitle').style.width="770px";


   }
   else
   {
  document.getElementById('boxtitle').innerHTML=h;
  document.getElementById('description1').innerHTML=d1;
  document.getElementById('description2').innerHTML=d2;
  document.getElementById('but1').innerHTML='<input type="button" id="btnyes" name="btnyes"  onClick="closebox();" class="yesbtn"/>';
  document.getElementById('but2').innerHTML='<input type="button" id="btnno" name="btnno"  onClick="changediv();"  class="nobtn"/>&nbsp;&nbsp;<input type="button" id="btndnknowno" name="btndnknowno"  onClick="changediv();"  class="dnknow"/>';
  document.getElementById('filter').style.display='block';
  document.getElementById("box").style.height="80px";
   document.getElementById("box").style.width="350px";
    document.getElementById('boxtitle').style.width="370px";
  
 /* document.getElementById('box').style.left=x;
  document.getElementById('box').style.top=y;*/
 
	// gradient("box", 0);
	 //fadein("box");
	
	
	
   }
  box.style.display='block';
  	
}


// Close the lightbox

function closebox()
{
	
   document.getElementById('box').style.display='none';
   document.getElementById('filter').style.display='none';
   document.getElementById("emaildiv").style.display='none';
   document.getElementById("maindiv").style.display='';
   document.getElementById("box").style.height="80px";
}
function closebox1()
{
	if(document.getElementById("txtname").value=="")
{
   alert("Enter Name");
   document.getElementById("txtname").focus();
   return false;
}
if(document.getElementById("txtphone").value=="")
{
   alert("Enter Phone No");
   document.getElementById("txtphone").focus();
   return false;
}

if(document.getElementById("txtemail").value=="")
{
   alert("Enter Email Id");
   document.getElementById("txtemail").focus();
   return false;
}
if(document.getElementById("txtemail").value!="")
 	{
		  if(document.getElementById('txtemail').value.indexOf('@',0) < 0)
	{
		
		alert("Enter Valid Email Id");
		document.getElementById('txtemail').focus();
		return false;
	}
	if(document.getElementById('txtemail').value.indexOf('.',0) < 0)
	{
		
		alert("Enter Valid Email Id");
		document.getElementById('txtemail').focus();
		return false;
	}
 	}
   name=document.getElementById("txtname").value;
   phone=document.getElementById("txtphone").value;
   email=document.getElementById("txtemail").value;
   window.open("index.php?nm="+name+"&pn="+phone+"&em="+email,'_self',true);
   document.getElementById('box').style.display='none';
   document.getElementById('filter').style.display='none';
   document.getElementById("emaildiv").style.display='none';
   document.getElementById("maindiv").style.display='';
   document.getElementById("box").style.height="80px";
   return true;
}
