
function Block(b,p)
{
	this.b = b;this.p = p;
}

function InitializeArea(btn,area)
{
	var btnName = btn.split(',');
	var areaName = area.split(';');
	var tmpArr; 
	
	
	var blockName;
	
	var btnObj = new Array(); 
	
	var linkObj = new Array(); 
	
	var areaObj = new Array();
	
	var block = new Array();
	 
	
	for(var i=0;i<parseInt(btnName[2]);i++)
	{
		btnObj[i] = document.getElementById(btnName[0] + '_' + (i+1));
		linkObj[i] = document.getElementById(btnName[1] + '_' + (i+1));
	}
	for(var i=0;i<areaName.length;i++)
	{
		tmpArr = areaName[i].split(':');
		areaObj[i] = document.getElementById(tmpArr[0]);
		blockName = tmpArr[1].split(',');
		for(var j=0;j<blockName.length;j++)
		{
			block[block.length] = new Block(document.getElementById(blockName[j]),areaObj[i]);
		}
	}
	
	for(var i=0;i<btnObj.length;i++)
	{
		btnObj[i].onmouseover = 
			function(ev)
			{
				if(this.className == 'noactive' || this.className == '')
				{
					
					for(var j=0;j<btnObj.length;j++)
					{
						if(btnObj[j].className == 'activetd')
						{
							btnObj[j].className = 'noactive';
							if(linkObj[j])
							{
								linkObj[j].className = 'subtitle';
								if(linkObj[j].firstChild && linkObj[j].firstChild.nodeName == 'A')
								{
									linkObj[j].firstChild.style.color = '#537E00';	
								}
							}
							
							if(block[j])
							{	
								block[j].b.style.display = 'none';
								block[j].p.style.display = 'none';
							}
							break;
						}
					}
				
					this.className = 'activetd';
					var li = parseInt(this.id.substring(this.id.lastIndexOf('_')+1)) - 1;					
					if(linkObj[li])
					{
						linkObj[li].className = 'activetitle';
						if(linkObj[li].firstChild && linkObj[li].firstChild.nodeName == 'A')
						{
							linkObj[li].firstChild.style.color = '';	
						}
					}
				
					if(block[li])
					{
						block[li].b.style.display = '';
						block[li].p.style.display = '';						
					}
					
				
					if(block[j] && block[li] && block[j].p != block[li].p)
					{
						for(var k = 0;k < block.length; k ++)
						{
							if(k != li)
							{
								if(btnObj[k])
								{
									btnObj[k].className = (block[k].p!=block[li].p?'':'noactive');
								}
							}
						}
					}
				}
			}
	}
}

function InitializeSingelArea(btn,blk)
{
	var buttonS = btn.split(',');
	var blockS = blk.split(',');
	var btnObjS = new Array();
	var blkObjS = new Array();
	for(var i=0;i<buttonS.length;i++)
	{
		btnObjS[i] = document.getElementById(buttonS[i]);
		blkObjS[i] = document.getElementById(blockS[i]);
	}
	for(var i=0;i<btnObjS.length;i++)
	{
		btnObjS[i].onmouseover = 
			function()
			{
				for(var j=0;j<btnObjS.length;j++)
				{
					if(btnObjS[j].bgColor != '')
					{
						btnObjS[j].bgColor = '';
						if(blkObjS[j])
						{
							blkObjS[j].style.display = 'none';
						}
						break;
					}
				}
				
				this.bgColor = '#8CB502';
				var bi = parseInt(this.id.substring(this.id.lastIndexOf('_')+1)) - 1;
				if(blkObjS[bi])
				{
					blkObjS[bi].style.display = '';
				}
			}
	}
}
//window.onload = 
//	function()
//	{
//		InitializeArea('Button,Link,4','Area_1:Block_1,Block_2;Area_2:Block_3,Block_4');
//		InitializeArea('Sutton,Links,7','Irea_2:Slock_1,Slock_2,Slock_3;Irea_2:Slock_4,Slock_5,Slock_6,Slock_7');
		//InitializeSingelArea('UButton_1,UButton_2,UButton_3','UBlock_1,UBlock_2,UBlock_3');
		//InitializeSingelArea('AButton_1,AButton_2','ABlock_1,ABlock_2');
		
//	}
function window_onload_Button1()
	{
//		if(document.getElementById("Area_1"))
		InitializeArea('Button,Link,4','Area_1:Block_1,Block_2;Area_2:Block_3,Block_4');
	}
function window_onload_Button2()
	{
//		if(document.getElementById("Area_1"))
		InitializeArea('Sutton,Links,7','Irea_2:Slock_1,Slock_2,Slock_3;Irea_2:Slock_4,Slock_5,Slock_6,Slock_7');
	}

//----------------120_80-----------------
function resizeM_124_98(el)
{

 if(el.runtimeStyle)
 {
	el.runtimeStyle.behavior="none";
 }

 var tempM = new Image();
 tempM.src = el.src ;
 tempM.el = el;
 tempM.onload = resizeMonLoad_124_98;
 tempM.doload = resizeMonLoad_124_98;
 if(el.fileSize && (el.fileSize>0)){; tempM.doload();};
}

function resizeMonLoad_124_98()
{
     var el = this.el;
	 var maxW = 124;
	 var maxH = 98;
	 el.style.visibility="visible";

	 if(this.width < maxW)
	 {
		el.style.width = this.width + "px";
	 }

	 if(this.height < maxH)
	 {
		el.style.height = this.height + "px";
	 }
	 
	 if(this.width>this.height)
	 {
		  if(this.width >= maxW)
		  {; 
			  var r = maxW / this.width;
			  el.style.height = (this.height * r ) + "px";
			  el.style.width = maxW + "px";
		  }
	 }
	 else
	 {
		if(this.height >= maxH)
		{
			var r = maxH / this.height;
			el.style.width = (this.width * r )+ "px";
			el.style.height = maxH + "px";
		}
	 }
}
//----------------105_83-----------------
function resizeM_100_75(el)
{

 if(el.runtimeStyle)
 {
	el.runtimeStyle.behavior="none";
 }

 var tempM = new Image();
 tempM.src = el.src ;
 tempM.el = el;
 tempM.onload = resizeMonLoad_100_75;
 tempM.doload = resizeMonLoad_100_75;
 if(el.fileSize && (el.fileSize>0)){; tempM.doload();};
}

function resizeMonLoad_100_75()
{
     var el = this.el;
	 var maxW = 100;
	 var maxH = 75;
	 el.style.visibility="visible";

	 if(this.width < maxW)
	 {
		el.style.width = this.width + "px";
	 }

	 if(this.height < maxH)
	 {
		el.style.height = this.height + "px";
	 }
	 
	 if(this.width>this.height)
	 {
		  if(this.width >= maxW)
		  {; 
			  var r = maxW / this.width;
			  el.style.height = (this.height * r ) + "px";
			  el.style.width = maxW + "px";
		  }
	 }
	 else
	 {
		if(this.height >= maxH)
		{
			var r = maxH / this.height;
			el.style.width = (this.width * r )+ "px";
			el.style.height = maxH + "px";
		}
	 }
}