/*======================================================================================
'	------------------------------------------------------------------------
'	Version History:
'	------------------------------------------------------------------------
'	Version:		Date:				Author:					Version Information:
'	1.0															Initial Version
'	1.1 - MS01		03/02/06			marina salambasis		Updates for whats happening section
'======================================================================================*/



function openPopup(strUrl) {  
	if (strUrl.length > 0)
		var newWnd = window.open(strUrl,'wndCLJPopup','width=600, height=400, directories=no, fullscreen=no, location=no, menubar=no, scrollbars=yes, resizable=no, status=no, toolbar=no'); 
}
function DisplayContentX(strHTML, objHTML){
	//alert(strHTML);
	objHTML.innerHTML = unescape(strHTML)
}

// Scripts for the Rotating News items....
var intSecondBetweenItems = 2;
var intPreviousItem = '0'; 


function DisplayContentY(strID, strDate, strAbstract, strLink, strImage, strHeight, strWidth, strCaption){
//alert(strImage); 
/*alert(hello)	displayObj = getObj("arrhomeNews"); //grab the div
	displayObj.innerHTML = ""
	arrHomeNews["strID"] =  new NewsItem('<div id=abstract><h3>' + strDate + '</h3>' + strAbstract + "<a href=" + strLink + ">More</a></div><div id=abstractImage><img src=" + strImage + " height=" + strHeight + " width=" + strWidth + " alt=" + strCaption + " /></div>");
	displayObj.innerHTML = arrHomeNews["strID"].strHtml
	strPreviousItem = strID;
	displayObj.innerHTML = unescape(arrHomeNews[strID].strHtml)	
	if(intNewsTotal == parseInt(strID)){
		intNextNewsID = 1	
	}else{
		intNextNewsID = parseInt(strID) + 1	
	}		
	intPreviousItem = strID
*/
}

function DisplayContent(strID){	
	if(intPreviousItem!=0)SwapButton(intPreviousItem,"btnOff");
	SwapButton(strID,"btnOn");
	displayObj = getObj("homeNewsItems");
	displayObj.innerHTML = ""
	displayObj.innerHTML = unescape(arrHomeNews[strID].strHtml)	
	if(intTotalItems == parseInt(strID)){
		intNextNewsID = 1	
	}else{
		intNextNewsID = parseInt(strID) + 1	
	}		
	intPreviousItem = strID
}

function getObj(id){
	if(document.getElementById){
		return document.getElementById(id);
	}else{
		return document.all[id];
	} 
}

function SwapButton(strID,strClass){
  //alert(strID)
	objButton = getObj("news_" + strID)
	objButton.className=strClass
}


function cycleNewsItems(intNextNewsID){
	if(blnCycleNews){
		DisplayContent(intNextNewsID)
		setTimeout("cycleNewsItems(intNextNewsID)", intSecondBetweenItems*2000)
	}
}

function DisplayNewsItem(strID, strDate, strAbstract, strLink, strImage, strHeight, strWidth, strCaption){
	blnCycleNews = false
	DisplayContent(strID);
}

function PauseNews(){
	blnCycleNews = false
}

function RestartNews(){
	if(!blnCycleNews){
		blnCycleNews = true
		cycleNewsItems(intNextNewsID);
	}
}	

function GoBackOne(){
	blnCycleNews = true
	intNextNewsID = intNextNewsID - 2
	if(intNextNewsID < 1){
		intNextNewsID = intNextNewsID + intTotalItems	
	}	
	DisplayContent(intNextNewsID);	
}

function GoForwardOne(){
	blnCycleNews = true
	DisplayContent(intNextNewsID);
}

function initNews(){
	cycleNewsItems(1)
}

/*
function change(){
document.getElementById("strID").style.backgroundColor = "#a1bbe4";
document.getElementById("strID").style.color = "#ffffff";
}

function change_back(){
document.getElementById("strID").style.backgroundColor = "#cec6b7";
document.getElementById("strID").style.color = "#000000";
}
*/

