var fontSize = 8;
var lineHeight = 16;

var currentdate = 0
var core = 0

i = new Array(6)
i[0] = 'images/0.jpg';
i[1] = 'images/1.jpg';
i[2] = 'images/2.jpg';
i[3] = 'images/3.jpg';
i[4] = 'images/4.jpg';
i[5] = 'images/5.jpg';
i[6] = 'images/6.jpg';
i[7] = 'images/7.jpg';
i[8] = 'images/8.jpg';

var ran = 60/i.length

function saveFaceSize()
{
	var expire = new Date ();
   	expire.setTime (expire.getTime() + (6000 * 24 * 3600000)); //expires in 6 days from users clock
   	expire = expire.toGMTString();
	document.cookie="fontSize="+fontSize+"; path=/; expires="+expire;
	document.cookie="path=/; expires="+expire;
}

function setFaceSize()
{
	lineHeight = fontSize+Math.round(.3*fontSize);

	for (i = 0; i < 3; i++)
	{
		if(obj = document.getElementById("at"+i))
		{		
			obj.style.fontSize = fontSize+"px";
			obj.style.lineHeight = lineHeight+"px";
		}
	}
	saveFaceSize();
}

function readCookie(name)
{
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++)
	{
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}	


function loadFaceSizeCookie()	{

	if(size = readCookie("fontSize")) 
	{
		fontSize = parseInt(size);
		if (fontSize > 16) {fontSize = 16;}
		setFaceSize();				
	}
	
}

function eventFaceLarger()
{
	fontSize = fontSize+1;
	if (fontSize > 16) {fontSize = 16;}
	setFaceSize();
}

function eventFaceSmaller()
{
	fontSize = fontSize-2
	if (fontSize < 9) fontSize = 9;
	setFaceSize();
}

function articlePrint()
{
	if (window.print)
	{
		window.print();
	}
	else
	{
		alert("Your web browser does not support standard web printing.\nPlease print the page using your browsers print command.");
	}
}

function openLink(theLink)
{
	win = window.open(theLink,"newWin","width=600,height=600,left=100,scrollbars=yes,resizable=yes,location=yes");
	win.focus;
}

function toolbarEvent(owner,status,image)
{
  window.status = status;
  document.getElementById(owner).src = image;
}

/*
function createTopItem(id, imgurlOn, imgurlOff, src) {

		var e = document.createElement("div");  

		e.setAttribute('id',id);
		e.style.width="107";
		e.className = 'top';
		e.style.height="20";
		i = new Image();
		i.src = imgurlOn;
		e.appendChild(i);		


		e.onclick = function () {
			if(e.childNodes.length <= 1)
//					window.location = src + '.html';
				window.location = id.substring(4) + '.html';
		}
		
		
		e.onmouseover = function () {
			document.getElementById(id).firstChild.src = imgurlOff;
		
			if(document.getElementById(id).childNodes.length > 1) {
				document.getElementById(id).childNodes.item(1).style.display="block";
			}
			else {
				//change cursor, not ie
				//if(navigator.appName.indexOf("Microsoft") == -1) 
					e.style.cursor='hand';
				//else
					e.style.cursor='pointer';
			}

			
		}
		
		e.onmouseout= function () {
			document.getElementById(id).firstChild.src = imgurlOn;

			if(document.getElementById(id).childNodes.length > 1)
				document.getElementById(id).childNodes.item(1).style.display="none";		
		}			
		
		return e;	
}

function createItem(id, text, menu) {
	
		var e = document.createElement("div");  
		e.setAttribute('id',id);
	
		if(menu == 1)
			e.setAttribute('menu','true');
		else
			e.onclick = function() {

				window.location = id.substring(1) + '.html';
			
			}	
		
		e.style.width="107";
		e.style.height="30";
		e.appendChild(document.createTextNode(text));		
	
		e.onmouseover = function () {
			
			if(this.getAttribute('menu') == 'true')
				this.className = 'subMenuItemHover';
			else
				this.className = 'simpleItemHover';

				if(document.getElementById(id).childNodes.length > 1) 
					document.getElementById(id).childNodes.item(1).style.display="block";
		}
		
		e.onmouseout= function () {

			if(this.getAttribute('menu') == 'true')
				this.className = 'subMenuItem';
			else
				this.className = 'simpleItem';

				if(document.getElementById(id).childNodes.length > 1)
					document.getElementById(id).childNodes.item(1).style.display="none";		
		}			
		
		return e;		
}


function createSubMenu(p,id, vertical) {
	father = document.getElementById(p);

	var submnu = document.createElement("div");  
	father.appendChild(submnu);

	submnu.style.backgroundColor="#4A7FC5";
	submnu.setAttribute('id',id);


	submnu.style.display="none";

	if(vertical == 0) //horizontal
	{
		submnu.style.position="absolute";	
		submnu.style.left = submnu.parentNode.style.width;
		
		//if not ie
		if(navigator.appName.indexOf("Microsoft") == -1) {
			
			submnu.style.position="relative";
			submnu.style.top = "-15px";
			submnu.style.left = "236px";
		}				
 	}
 	else {
	 	submnu.style.position="absolute";
		submnu.style.left = (father.offsetLeft+"px");
		submnu.style.top = (father.offsetHeight+"px");
		
		//if not ie
		if(navigator.appName.indexOf("Microsoft") == -1) {
			
			submnu.style.top = "45px";
		}

 	}

	return submnu;		
}
*/

