function makerequest(serverPage, objID) {
		
	//Create a boolean variable to check for a valid Internet Explorer instance.
	var xmlhttp = false;
	
	//Check if we are using IE.
	try {
		//If the Javascript version is greater than 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
		//If not, then use the older active x object.
		try {
			//If we are using MS.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (e) {
			//Else we must be using a non-IE browser.
			xmlhttp = false;
		}
	}
	
	//If we are using a non-IE browser, create a javascript instance of the object.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}
	
	
	/*
	var xmlhttp;
	
	//If, the activexobject is available, we must be using IE.
	if (window.ActiveXObject){
		xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
	} else {
		//Else, we can use the native Javascript handler.
		xmlhttp = new XMLHttpRequest();
	}
	*/
		
	var obj = document.getElementById(objID);
	xmlhttp.open("GET", serverPage);
	xmlhttp.onreadystatechange = function() {
		if (xmlhttp.readyState == 4 && xmlhttp.status == 200) {
			obj.innerHTML = xmlhttp.responseText;
		}
	}
	xmlhttp.send(null);
}

function rotateItem() {
	makerequest("newsitem.php", "newsBlock");
	timerid = setTimeout("rotateItem()",15000);
}

function getMarginLeft(img) {
	var ml=img.marginLeft;
	return ml;
}
function getMarginRight(img) {
	var mr=img.marginRight;
	return mr;
}
function getMarginTop(img) {
	var mt=img.marginTop;
	return mt;
}
function getMarginBottom(img) {
	var mb=img.marginBottom;
	return mb;
}

function growImage(img,bigImage,growY,growX) {	
	bigImageObject=new Image();
	bigImageObject.src=bigImage;
	sX=img.width;
	sY=img.height;
	bX=bigImageObject.width;
	bY=bigImageObject.height;
	img.src=bigImage;
	if (growY=="bottom") {
		img.style.marginTop=(sY-bY+12)+"px";
	} else if (growY=="middle") {
		img.style.marginBottom=(((sY-bY)/2)+6)+"px";
		img.style.marginTop=(((sY-bY)/2)+6)+"px";
	} else {
		img.style.marginBottom=(sY-bY+12)+"px";	
	}
	if (growX=="left") {
		img.style.marginRight=(sX-bX+12)+"px";
	} else {
		img.style.marginLeft=(sX-bX+12)+"px";	
	}
}

function shrinkImage(img,smallImage,shrinkY,shrinkX) {	
	smallImageObject=new Image();
	smallImageObject.src=smallImage;
	bX=img.width;
	bY=img.height;
	sX=smallImageObject.width;
	sY=smallImageObject.height;
	img.src=smallImage;
	if (shrinkY=="bottom") {
		img.style.marginTop=12+"px";
	} else if (shrinkY=="middle") {
		img.style.marginBottom=6+"px";
		img.style.marginTop=6+"px";
	} else {
		img.style.marginBottom=12+"px";	
	}
	if (shrinkX=="left") {
		img.style.marginRight=12+"px";
	} else {
		img.style.marginLeft=12+"px";	
	}
}

function preLoadImages() {
var num = preLoadImages.arguments.length;
var i = 0;
var images = new Array();

while (i<num) {
images[i] = new Image();
images[i].src = preLoadImages.arguments[i];
i++;
}
}

function addFlashContent(movie,width,height,title,quality) {
	
	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+width+'" height="'+height+'" title="'+title+'"><param name="movie" value="'+movie+'" /><param name="quality" value="'+quality+'" /><embed src="'+movie+'" quality="'+quality+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+width+'" height="'+height+'"></embed></object>');
	
}

function genPass(passLen) {
	var charString="123456789abcdefghijklmnipqrstuvwxyzABCDEFGHIJKLMNPQRSTUVWXYZ";
	var pass="";
	for (i=0;i<passLen;i++) {
		start = Math.floor(Math.random()*(charString.length+1));
		pass+=charString.substring(start,(start+1));
	}
	return pass;
}

function showHide(element,labelBlock) {
	var a = document.getElementById(element);
	var b = document.getElementById(labelBlock);
	
	if (a.style.display=="none") {
		a.style.display="block";
		b.innerHTML="Hide";
	} else {
		a.style.display="none";
		b.innerHTML="View";
	}
	
}