// JavaScript Document

var oldRightSub = false;

function ChangeRightSub(newMenu, actualMenu)
{
	try
	{
		if(!oldRightSub)
		{
			oldRightSub = actualMenu;
		}
		
		if(document.getElementById(oldRightSub))
		{
			document.getElementById(oldRightSub).style.display = "none";
		}
		
		document.getElementById(newMenu).style.display = "inline";
		
		oldRightSub = newMenu;
	}
	catch(e)
	{
		alert(e.message);
	}
}

var oldLeftSub = false;

function ChangeLeftSub(newMenu, actualMenu)
{
	try
	{
		if(!oldLeftSub)
		{
			oldLeftSub = actualMenu;
		}
		
		if(document.getElementById(oldLeftSub))
		{
			document.getElementById(oldLeftSub).style.display = "none";
		}
		
		document.getElementById(newMenu).style.display = "inline";
		
		oldLeftSub = newMenu;
	}
	catch(e)
	{
		alert(e.message);
	}
}



var oldMenuCategory = false;

function ShowFilterCategory(newMenu, actualMenu)
{
	try
	{
		if(!oldMenuCategory)
		{
			oldMenuCategory = actualMenu;
		}
				
		document.getElementById(oldMenuCategory).style.display = "none";
		document.getElementById(newMenu).style.display = "inline";
		
		oldMenuCategory = newMenu;
	}
	catch(e){}
}

function ShowHelp(helpIdVisible, helpIdHidden)
{
	try
	{
		document.getElementById(helpIdHidden).style.display = "none";
		document.getElementById(helpIdVisible).style.display = "block";
	}
	catch(e){}
}

var oldPhotoTag = null;
var oldThumbPath = null;

function ShowPhoto(photoTag, largePath, thumbPath)
{
	try
	{		
		
		photoTag.src = largePath;
		photoTag.className = "large";		
	
		if(oldPhotoTag != null)
		{
			oldPhotoTag.className = "thumb";	
			oldPhotoTag.src = oldThumbPath;
		}
		
		oldPhotoTag = photoTag;
		oldThumbPath = thumbPath;
	}
	catch(e){alert(e)}
}

function DeleteExploreSearch(obj, type, defaultValue)
{
	try
	{
		if(type)
		{
			if(obj.value == defaultValue)
			{
				obj.value = '';	
				obj.className = 'ifWrite';
			}
		}
		else
		{
			if(obj.value == '')
			{
				obj.value = defaultValue;	
			}
			
			obj.className = 'ifNotWrite';
		}
	}
	catch(e){}
}


function ChangeLeftSidePic(srcPic)
{
	
	try
	{
		document.getElementById('leftSidePic').src = srcPic;
	}
	catch(e){}
}

