var showMode = 'table-cell';
if (document.all) showMode='block';

// This is the function that actually does the manipulation
function toggleVis101(btn){

var target=document.getElementsByName('butonaddcat');
if(btn>0)
{
target[0].style.display=showMode;
//target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
//target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

        cells = document.getElementsByName('categshow'+i);
        for(j = 0; j <cells.length; j++)
        {
                if(cells[j].name=='categshow'+btn)
                {
                        cells[j].style.display = showMode;
                }
                else
                {
                        cells[j].style.display = 'none';
                }
        }

}
}

function toggleVis(btn){

var target=document.getElementsByName('tcol7');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';

}
for(i=1;i<7;i++)
{

	cells = document.getElementsByName('tcol'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='tcol'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}


function toggleVis3a(btn){
for(i=1;i<11;i++)
{

        cells = document.getElementsByName('formular'+i);
        for(j = 0; j <cells.length; j++)
        {
                if(cells[j].name=='formular'+btn)
                {
                        cells[j].style.display = showMode;
                }
                else
                {
                        cells[j].style.display = 'none';
                }
        }

}
}





function toggleVis2(btn){
for(i=1;i<7;i++)
{

	cells = document.getElementsByName('stcol'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='stcol'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}


function toggleVisforpro(btn,count){
//alert(btn);
//alert(count);

if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('subcategshow'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'subcategshow'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('subcategshow'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}


function toggleVisforpro1(btn,count){

if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('subsubcategshow'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'subsubcategshow'+btn)
		{ 
			cells123[0].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
		
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('subsubcategshow'+j);
		cells123[0].style.display = 'none';
		cells123[0].refresh;
	}
}

}




function toggleVisforpro2(btn,count){

if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('cityshow'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'cityshow'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('cityshow'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}

function toggleVisforproloc(btn,count){

document.addprop.newlocationindex.value = btn;
//alert(btn);
//alert(count);
if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('location'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'location'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('location'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}



// for search

function toggleVisforpro2search(btn,count){
document.search_advanced.selectedcountry.value = btn;
document.search_advanced.selectedcity.value=0;
document.search_advanced.selectedlocation.value=0;
if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('cityshow'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'cityshow'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('cityshow'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}

function toggleVisforprolocsearch(btn,count){

document.search_advanced.selectedcity.value = btn;
document.search_advanced.selectedlocation.value=0;
//alert(btn);
//alert(count);
if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('location'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'location'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('location'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}



//end for search

// For inquary register

function toggleVisforpro2inqreg(btn,count){
document.register.selectedcountry.value = btn;
document.register.selectedcity.value=0;
document.register.selectedlocation.value=0;
if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('cityshow'+j);
		//alert(cells123[0].name);
		if(cells123[0].name == 'cityshow'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('cityshow'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}

function toggleVisforprolocinqreg(btn,count){

document.register.selectedcity.value = btn;
document.register.selectedlocation.value=0;
//alert(btn);
//alert(count);
if(btn != 0)
{
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('location'+j);
	//	alert(cells123[0].name);
		if(cells123[0].name == 'location'+btn)
		{ 
			cells123[0].style.display = showMode;
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('location'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
}

}




// End for inquairy register
function toggleVis3(btn){
/*
var target=document.getElementsByName('tcol7');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';
}
*/
for(i=1;i<9;i++)
{

	cells = document.getElementsByName('formular'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='formular'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}
function toggleVisContact(btn,count){

if(btn != 0)
{
cellsave = document.getElementsByName('contactsave');	
	for(j = 1; j<=count;j++)
	{ 
		cells123 = document.getElementsByName('contact'+j);
		if(cells123[0].name == 'contact'+btn)
		{ 
				cells123[0].style.display = '';
			//cells123[1].style.display = showMode;
		}
		else
		{
			cells123[0].style.display = 'none';
			//cells123[1].style.display = 'none';
		}
	}
cellsave[0].style.display = '';	
}
else
{
	for(j = 1; j<count+1;j++)
	{
		cells123 = document.getElementsByName('contact'+j);
		cells123[0].style.display = 'none';
		//cells123[1].style.display = 'none';
	}
	cellsave[0].style.display = 'none';	
}

}


function toggleVis4(btn){


var target=document.getElementsByName('buton1');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';
}

//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf1'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf1'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis5(btn){

var target=document.getElementsByName('buton2');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf2'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf2'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis6(btn){

var target=document.getElementsByName('buton3');
if(btn>0)
{
target[0].style.display=showMode;
//target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
//target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf3'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf3'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis7(btn){

var target=document.getElementsByName('buton4');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
target[2].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';
target[2].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf4'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf4'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis8(btn){

var target=document.getElementsByName('buton5');
if(btn>0)
{
target[0].style.display=showMode;
//target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
//target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf5'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf5'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis9(btn){

var target=document.getElementsByName('buton6');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf6'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf6'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVisb1(btn){

var target=document.getElementsByName('buton7');
if(btn>0)
{
target[0].style.display=showMode;
target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf7'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf7'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis10(btn){

var target=document.getElementsByName('butonaddcat');
if(btn>0)
{
target[0].style.display=showMode;
//target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
//target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('categshow'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='categshow'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}


function toggleVis11(btn){
//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('prop'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='prop'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function toggleVis12(btn){

var target=document.getElementsByName('buton10');
if(btn>0)
{
target[0].style.display=showMode;
//target[1].style.display=showMode;
}
else
{
target[0].style.display='none';
//target[1].style.display='none';
}


//alert(btn);
for(i=1;i<8;i++)
{

	cells = document.getElementsByName('titleshowf10'+i);
	for(j = 0; j <cells.length; j++)
	{
		if(cells[j].name=='titleshowf10'+btn)
		{
			cells[j].style.display = showMode;
		}
		else
		{
			cells[j].style.display = 'none';
		}
	}

}
}

function togglerent(btn){

 // First isolate the checkbox by name using the
	// name of the form and the name of the checkbox

	btn   = document.forms['addprop'].elements[btn];

	// Next find all the table cells by using the DOM function
	// getElementsByName passing in the constructed name of
	// the cells, derived from the checkbox name

	cells = document.getElementsByName('price'+btn.name);

	// Once the cells and checkbox object has been retrieved
	// the show hide choice is simply whether the checkbox is
	// checked or clear

	mode = btn.checked ? showMode : 'none';

	// Apply the style to the CSS display property for the cells

	for(j = 0; j < cells.length; j++) cells[j].style.display = mode;


}

function togglesell(btn){

 // First isolate the checkbox by name using the
	// name of the form and the name of the checkbox

	btn   = document.forms['addprop'].elements[btn];

	// Next find all the table cells by using the DOM function
	// getElementsByName passing in the constructed name of
	// the cells, derived from the checkbox name

	cells = document.getElementsByName('price'+btn.name);

	// Once the cells and checkbox object has been retrieved
	// the show hide choice is simply whether the checkbox is
	// checked or clear

	mode = btn.checked ? showMode : 'none';

	// Apply the style to the CSS display property for the cells

	for(j = 0; j < cells.length; j++) cells[j].style.display = mode;


}
