// JavaScript Document
/*SWapung the images of the left menu */
function swapImage(elementName){
	
	var element = document.getElementById(elementName);
	var newImage = elementName+'Sel';
	var newHTML = "<img src='images/menuImages/"+newImage+".png border='0'/>";
	element.innerHTML = newHTML;
}

function writeCookie( selectedValue )
{
	var selectedCookie = 'APZ=' + selectedValue+'\'';
	document.cookie = selectedCookie;
}

function readCookie()
{
	var cookieName = 'APZ=';

	var allCookies = document.cookie;
	if( allCookies == '' )
	{
		return 'p4';
	}
	
	var beginCookie = allCookies.indexOf (cookieName);
	
	if( beginCookie == -1 )
	{
		alert('beginCookie NOT Found');
		return 'p4';
	}
		
	beginCookie += 4; // Move to value in cookie

	return(allCookies.substring(beginCookie));
}

function P7_swapClass()
{
	var arg = P7_swapClass.arguments;
	var tA = new Array();

	if(document.getElementsByTagName)
	{
		var i = 0;
			for( i = 4; i < arg.length; i++ )
			{
				var x = 0;
				var tB = document.getElementsByTagName(arg[i]);
				for( x = 0; x < tB.length; x++ )
				{
					tA[x] = tB[x];
				}
			}
			
			for( i = 0; i < tA.length; i++)
			{
				if( tA[i].className )
				{
					if( tA[i].id == arg[1] )
					{
						if( arg[0] == 1 )
						{
							tA[i].className = (tA[i].className == arg[3])?arg[2]:arg[3];
						}
						else
						{
							tA[i].className = arg[2];
						}
					}
					else if(arg[0] == 1 && arg[1] == 'none')
					{
						if(tA[i].className == arg[2] || tA[i].className == arg[3])
						{
							tA[i].className = (tA[i].className == arg[3])?arg[2]:arg[3];
						}
					}
					else if(tA[i].className == arg[2])
					{
						tA[i].className=arg[3];
					}
				}
			}
		}
		writeCookie(arg[1]);
	}

function P7_writeStyles(op,a)
{ //v1.5 by PVII
	if(op==0||document.getElementById)
	{
		var tS="<sty"+"le type=\"text/css\">";
		tS+=a+"<"+"/sty"+"le>";
		document.write(tS);
		document.close();
	}
}

P7_writeStyles(1,'.closed ul{ display:none;}.open ul{ display:block;}');

