// JavaScript Document

/* Top Navigation Menu Selection onClick */
function topMenuTab(tab){
	var par =document.getElementById('aopTopNavigation');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{	
		if (childs[i].id == tab.id)
		{
			childs[i].className = "activeClass";
		}
		else
		{
			childs[i].className = "deactiveClass";
		}
	}
}

/* Sub Navigation Menu Selection onClick */
function subMenuTab(tab){
	var par =document.getElementById('mMenu');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{	
		if (childs[i].id == tab.id)
		{
			childs[i].className = "select";
		}
		else
		{
			childs[i].className = "";
		}
	}
}

/* Image Navigation Menu Selection onClick */
function imgMenuTab(tab){
	var par =document.getElementById('imgTab');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{	
		if (childs[i].id == tab.id)
		{
			childs[i].className = "imgTabSel";
		}
		else
		{
			childs[i].className = "";
		}
	}
}

/* Resale Property Navigation Menu Selection onClick */
function rpMenuTab(tab){
	var par =document.getElementById('aopRP');
	var childs=par.getElementsByTagName('div');
	for(i=0; i<childs.length; i++)
	{	
		if (childs[i].id == tab.id)
		{
			childs[i].className = "actSearchtab";
		}
		else
		{
			childs[i].className = "searchtab";
		}
	}
}
function optionalData(){
	var objOptional = document.getElementById('optionalInfoContainer');
	var objImgArrow = document.getElementById('imgOptionalArrow');
	
	if(objOptional.className=="none"){
	objOptional.className="block";
	objImgArrow.src="images/arrow.gif";}
	else{
	objOptional.className="none";
	objImgArrow.src="images/arrowRight.gif";}
}

/* DashBoard Navigation Selection */
function db_subMenuTab(tab){
	var par =document.getElementById('db_MainMenu');
	var objSubmenu = document.getElementById('db_subNavigation');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{	
		if (childs[i].id == tab.id)
		{
			childs[i].className = "dbSelected";			
			if(tab.id=="dbMyAccount")
			{
				objSubmenu.innerHTML = "<div align='center'><a href='#'>Dashboard</a> | <a href='#'>Inbox</a> | <a href='#'>Property of Interest</a> | <a href='#'>Property of Requirements</a> | <a href='#'>Properties I am selling</a></div>";
			}
			if(tab.id=="dbMySetting")
			{
				objSubmenu.innerHTML = "<div align='center'><a href='#'>Contact Information</a> | <a href='#'>Login Information</a> | <a href='#'>Notification Preference</a> | <a href='#'>Subscriptions</a> | <a href='#'>Past Invoices</a> | <a href='#'>Close Account</a></div>";
			}
			if(tab.id=="dbDzone")
			{
				objSubmenu.innerHTML = "<div align='center'><a href='#'>Property I am selling</a> | <a href='#'>Create New Listing</a> | <a href='#'>Leads</a> | <a href='#'>Developer Profile</a> | <a href='#'>Developer Microsite</a> | <a href='#'>Developer Search</a></div>";
			}
			if(tab.id=="dbAzone")
			{
				objSubmenu.innerHTML = "<div align='center'><a href='#'>Property I am selling</a> | <a href='#'>Create New Listing</a> | <a href='#'>My Commission</a> | <a href='#'>Project Commission</a> | <a href='#'>Leads</a> | <a href='#'>Agent Profile</a> | <a href='#'>Agent Microsite</a> | <a href='#'>Agent Search</a></div>";
			}
			if(tab.id=="dbMyInfo")
			{
				objSubmenu.innerHTML = "<div align='center'><a href='#'>Dashboard</a> | <a href='#'>Inbox</a> | <a href='#'>Property of Interest</a> | <a href='#'>Property of Requirements</a> | <a href='#'>Properties I am selling</a></div>";
			}
		}
		else
		{
			childs[i].className = "";
		}
	}
}

/* INBOX Tab */
/* Sub Navigation Menu Selection onClick */
function inb_subMenuTab(tab){
	var par =document.getElementById('inbMenuID');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{	
		if (childs[i].id == tab.id)
		{
			childs[i].className = "select";
		}
		else
		{
			childs[i].className = "";
		}
	}
}

/* Show Property Listing */
function driveDiv(divName){
	var objDiv = document.getElementById(divName);
	if(objDiv.className=="none"){
		objDiv.className="block";
	} else{
		objDiv.className="none";
	}
}

/* Project Microsite */
function funinfoMicroproperty(tab){
	var par =document.getElementById('infoMicroproperty');
	var childs=par.getElementsByTagName('a');
	for(i=0; i<childs.length; i++)
	{
		if (childs[i].id == tab.id)
		{
			childs[i].className = "selectedmicros";
			document.getElementById(childs[i].id+"_Id").style.display = "block";
		}
		else
		{
			childs[i].className = "";
			document.getElementById(childs[i].id+"_Id").style.display = "none";
		}
	}
}
