//Shailesh kumar singh
//Date:-26/06/08
//This function will show the div
function showdiv(div)
{
   	//alert(div);
	var objtr = document.getElementById(div);
	objtr.style.display = "block";
	if (objtr.id == 'divadi' )
	{
		hidediv('divpdi');
	}
	if (objtr.id == 'divpdi' )
	{
		hidediv('divadi');
	}


}
//This function will hide the div
function hidediv(div)
{
	var objtr = document.getElementById(div);
		//alert(objtr.id)
	objtr.style.display = "none";
	//alert(objtr.id);
	if (objtr.id == 'divaccd1d' )
	{
			hidediv('divaccd1d2');
			hidediv('divaccd1d3');
			hidediv('divaccd1d4');
			hidediv('divaccd1d5');
	}
	if (objtr.id == 'divaccd2d' )
	{
		hidediv('divaccd2d2');
		hidediv('divaccd2d3');
		hidediv('divaccd2d4');
		hidediv('divaccd2d5');
	}
	if (objtr.id == 'divconvd1d' )
	{
		hidediv('divconvd1d2');
		hidediv('divconvd1d3');
		hidediv('divconvd1d4');
		hidediv('divconvd1d5');
	}
	if (objtr.id == 'divconvd2d' )
	{
		hidediv('divconvd2d2');
		hidediv('divconvd2d3');
		hidediv('divconvd2d4');
		hidediv('divconvd2d5');
	}
	if (objtr.id == 'divdisd1d' )
	{
		hidediv('divdisd1d2');
		hidediv('divdisd1d3');
		hidediv('divdisd1d4');
		hidediv('divdisd1d5');
	}
	if (objtr.id == 'divdisd2d' )
	{
		hidediv('divdisd2d2');
		hidediv('divdisd2d3');
		hidediv('divdisd2d4');
		hidediv('divdisd2d5');
	}
	if (objtr.id == 'divdisd3d' )
	{
		hidediv('divdisd3d2');
		hidediv('divdisd3d3');
		hidediv('divdisd3d4');
		hidediv('divdisd3d5');
	}
	if (objtr.id == 'divdisd4d' )
	{
		hidediv('divdisd4d2');
		hidediv('divdisd4d3');
		hidediv('divdisd4d4');
		hidediv('divdisd4d5');
	}
	if (objtr.id == 'divcondd1d' )
	{
		hidediv('divcondd1d2');
		hidediv('divcondd1d3');
		hidediv('divcondd1d4');
		hidediv('divcondd1d5');
	}
	if (objtr.id == 'divcondd2d' )
	{
		hidediv('divcondd2d2');
		hidediv('divcondd2d3');
		hidediv('divcondd2d4');
		hidediv('divcondd2d5');
	}
	if (objtr.id == 'divcondd3d' )
	{
		hidediv('divcondd3d2');
		hidediv('divcondd3d3');
		hidediv('divcondd3d4');
		hidediv('divcondd3d5');
	}
	if (objtr.id == 'divcondd4d' )
	{
		hidediv('divcondd4d2');
		hidediv('divcondd4d3');
		hidediv('divcondd4d4');
		hidediv('divcondd4d5');
	}	
}

function Maindriver(id) {
	
	
	if(id == 'Other')
		document.getElementById("mainother").style.display = 'block';
	else
		document.getElementById("mainother").style.display = 'none';
}



function Seconddriver(id) {
	
	if(id == 'Other')
		document.getElementById("secondother").style.display = 'block';
	else
		document.getElementById("secondother").style.display = 'none';
}

function showddldiv2()
{
	
	var objtr = document.getElementById('business');
	if (objtr.value == 'Private individual' || objtr.value == 'Ltd Co' || objtr.value == 'Property Managing Agent' || objtr.value == 'Residents Association' || objtr.value == 'Co Proprietors bondholder' || objtr.value == 'Right to Manage Co' || objtr.value == 'Commonhold Assoc' || objtr.value == 'Property developer')
	{	
		//alert(objtr.value);
		hidediv('divlastes');
	}
	else
	{	//alert(objtr.value);
		showdiv('divlastes');
		var obj1 = document.getElementById('other_business');
		obj1.focus();
 	}
}

function showddldiv1()
{
	var objprts= document.getElementById('property');
	//alert(objprts.value);
	if(objprts.value=='Residential property')
	{
		hidediv('divlast2');
		showdiv('divlast1');
		var obj2 = document.getElementById('Other_Residential_property');
//		obj2.focus();
	}

	if(objprts.value=='Commercial property')
	{
		hidediv('divlast1');
		hidediv('divlast2');
		showdiv('divlast2');
		var obj3 = document.getElementById('Other_Commercial_property');
		//obj3.focus();
	
	}
	if(objprts.value=='Mixed')
	{
		hidediv('divlast1');
		hidediv('divlast2');
	}
	if(objprts.value=='')
	{
		hidediv('divlast1');
		hidediv('divlast2');
	}
}

function showddldiv4()
{
	var objtr = document.getElementById('Construction_of_walls'); 

	if (objtr.value == 'Brick' || objtr.value == 'Stone')
	{	
		hidediv('divlast4');
	}
	else
	{	
		showdiv('divlast4');
		var obj1 = document.getElementById('Construction_of_walls');
 	}
}


function showddldiv5()
{ 
	var objtr = document.getElementById('Construction_of_roof');   
	 
	if (objtr.value == 'Slate' || objtr.value == 'Tile' || objtr.value == 'Concrete')
	{	
		hidediv('divlast5');
	}
	else
	{	

		showdiv('divlast5');
		var obj1 = document.getElementById('Construction_of_roof_other');
		obj1.focus();
 	}
}
function showddldiv6()
{
	var objtr = document.getElementById('Construction_of_floor'); 

	if (objtr.value == 'Wood' || objtr.value == 'Concrete')
	{	
		hidediv('divlast6');
	}
	else
	{	

		showdiv('divlast6');
		var obj1 = document.getElementById('Construction_of_floors');
		obj1.focus();
 	}
}

function showddldiv12()
{
	var objroof = document.getElementById('what_percentage_is_flat');
	if (objroof.value ='zero')
	{	
	
		showdiv('divlast3');
		//var obj11 = document.getElementById('roof11');
	} else {
		hidediv('divlast3');
	}	
}

function showhead()
{
	var obj = document.getElementById('heading');
	if (obj.value == 'Other')
	{
			showdiv('divheading');
	}
	else
	{
			hidediv('divheading');
	}
}

function bodytype(id) {
		
	if(id == 'Other')
		document.getElementById("otherbodytype").style.display = 'block';
	else
		document.getElementById("otherbodytype").style.display = 'none';
}

function showddlall(intval)
{
		if(intval=="2") {
		
		hidediv('divlastall');
		
		alert("Thank you \n Please click submit and we will contact you to collect further information on your properties.");
		
		//var objtr = document.getElementById('lblmsg');
		//objtr.style.visibility = 'visible';
		document.getElementById("lblmsg").style.display = 'block';
	}		
	else {
		//hidediv('lblmsg');
		showdiv('divlastall');
		document.getElementById("lblmsg").style.display = 'none';
		
	}
}

function fn_HomeOwner(id) {
		if(id == 'Yes'){
			document.getElementById("homeownerrenewal").style.display = 'block';
		}
		else {
			document.getElementById("homeownerrenewal").style.display = 'none';
		}
	}
