function randImage()
{
	newClass =  [  "bg1Class",   "bg2Class",   "bg3Class" ];
	var newClass = newClass[Math.floor(Math.random()*newClass.length)];
	var divID = document.getElementById("sidePoint");
	divID.className = newClass;
}

function goToPage(pageName)
{
	pageURL = pageName;
	window.location.href = pageURL;
}

function changeAll(imgID, imgName, txtID, bgId)
{
	var imgSrc, imageID, imageName, textID, defText, cellID, classID;
	imageID = imgID;
	imageName = imgName;
	imageSrc = document.getElementById(imageID);
	textID = document.getElementById(txtID);
	defText = document.getElementById("defTxt");
	divID = document.getElementById("sidePoint");
	classID = bgId;
	
	imageSrc.src = "images/icons/" + imageName + '-on.png';
	textID.className = "shownText";
	defText.className = "hiddenText";
	divID.className = "bg" + bgId;
}

function restoreAll(imgID, imgName, txtID)
{
	var imgSrc, imageID, imageName, textID, defText, cellID, classID;
	imageID = imgID;
	imageName = imgName;
	imageSrc = document.getElementById(imageID);
	textID = document.getElementById(txtID);
	defText = document.getElementById("defTxt");
	divID = document.getElementById("sidePoint");
	
	imageSrc.src = "images/icons/" + imageName + '-off.png';
	textID.className = "hiddenText";
	defText.className = "shownText";
	randImage()
}

function showTip()
{
	var myWidth = 0, myHeight = 0, pageMidH, pageMidV, totPopUp;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		myWidth = window.innerWidth;
		myHeight = window.innerHeight;
	}
	else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
		myHeight = document.documentElement.clientHeight;
	}
	else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	}
	

	pageMidH = (myWidth/2) - 100;
	pageMidV = (myHeight/2) - 175;
	totPopUp = document.getElementById("tipOfToday");
	
	totPopUp.style.display = 'block';
	totPopUp.style.visibility = 'visible';
	totPopUp.style.left = pageMidH;
	totPopUp.style.top = pageMidV;
	totPopUp.style.position = 'absolute';
}
function closeTip()
{
	totPopUp = document.getElementById("tipOfToday");
	totPopUp.style.display = "none";
}
function writeFooter()
{

	document.write("<center><div class='copyRights'>&copy2009 All Rights Reserved. Hisham Qaddoumi. <br />");
	document.write("Any usage of this sites\' content must be authorized by the site owner.</div></center>");
}
