﻿
var strAllPopups = 'tabPane1,tabPane2,tabPane3,contactpopup,contactpopup2,contactpopup3,likelist,likelist2,likelist3,iwanttotry,iwanttotry2,iwanttotry3,';

function RemoveOtherPopups(AllPopups,divId)
{
    
    var divIDToRemove = divId + ',';
	var popupsToRemove = AllPopups.replace(divIDToRemove,'');
	var arrayPopUps = popupsToRemove.split(',');
	var i;
	for(i=0;i<arrayPopUps.length;i++)
	{
	    if(document.getElementById(arrayPopUps[i]) != null)
	    {
	        document.getElementById(arrayPopUps[i]).style.display = 'none';
	    }
	}
}

function toggleDiv(divId)
{
    document.getElementById(divId+'div1').style.display='block';
    document.getElementById(divId+'div2').style.display='none';
    
	if(document.getElementById(divId).style.display == 'block')
		{document.getElementById(divId).style.display = 'none';}
	else
		{
		document.getElementById(divId).style.display = 'block';
		}
		
//		if(divId=='tabPane1')
//		{
//		    hide_div('tabPane2');
//		    hide_div('tabPane3');
//		}
//		else if(divId=='tabPane2')
//		{
//		    hide_div('tabPane1');
//		    hide_div('tabPane3');
//		}
//		else if(divId=='tabPane3')
//		{
//		hide_div('tabPane1');
//		hide_div('tabPane2');
//		}

	
		RemoveOtherPopups(strAllPopups,divId);
	

}


function close_div(divId)
{
        if(document.getElementById(divId+'div2').style.display == 'block')
		{
		
		 document.getElementById(divId+'div2').style.display='none';
		}
	    if(document.getElementById(divId+'div1').style.display == 'none')
		{
		
		 document.getElementById(divId+'div1').style.display='block';
		}
	
	
	    if(document.getElementById(divId).style.display == 'block')
		{
		document.getElementById(divId).style.display = 'none';
			
		}	
		
		return false;
}
function open_div(divId)
{

        if(document.getElementById(divId+'div2').style.display == 'none')
		{
		
		 document.getElementById(divId+'div2').style.display='block';
		}
	    if(document.getElementById(divId+'div1').style.display == 'block')
		{
		
		 document.getElementById(divId+'div1').style.display='none';
		}

		RemoveOtherPopups(strAllPopups,divId);
	
}

function hide_div(divId)
{
    
	if(document.getElementById(divId).style.display == 'block')
		{
		document.getElementById(divId).style.display = 'none';
		
		}
}


function show_div(divId)
{
	if(document.getElementById(divId).style.display == 'none')
		document.getElementById(divId).style.display = 'block';
		
	if(divId.indexOf('graybgdiv')<0)
	{ 
		RemoveOtherPopups(strAllPopups,divId);
	}

   
}