function ticker(tickerObjId, tickerMsg, tickerPos, tickerDelay) {
  var i,k,msg=tickerMsg,position=tickerPos,tickerObj=document.getElementById(tickerObjId);
  k=(tickerObj.size/msg.length)+1;
  for(i=0;i<=k;i++) msg+=" "+msg;
  tickerObj.value=msg.substring(position,position+tickerObj.size+10);
  if(position++==msg.length+38) position=0;
  id=setTimeout("ticker('"+tickerObjId+"','"+ tickerMsg+"',"+ position+","+tickerDelay+")",tickerDelay); 
}

function tickerv2(tickerObjId, tickerMsg, tickerPos, tickerDelay) {
  var i,k,msg=tickerMsg,position=tickerPos,tickerObj=document.getElementById(tickerObjId);
  k=(tickerObj.innerHTML.lenght/msg.length)+1;
  for(i=0;i<=k;i++) msg+=" "+msg;
  tickerObj.innerHTML=msg.substring(position,position+tickerObj.size+10);
  if(position++==msg.length+38) position=0;
  id=setTimeout("ticker('"+tickerObjId+"','"+ tickerMsg+"',"+ position+","+tickerDelay+")",tickerDelay); 
}

function changeImg_20050823(i,img,spaName,pics,subs,changeDelay) {
//-----------------------------------
//<created by rjm 08/22/05, dynamic pic gallery, changes image and associated span text in a given frequency>
//parameters
//i: the index of the pic/text to be shown
//img: handle to the img html tag that displays the image
//spaName: name of the span tag that displays the associated text
//pics: array of pics to display
//subs: array of subtitles texts to display in the span associated to each img in pics
//changeDelay: time between changes in ms
//</created by rjm 08/22/05, dynamic pic gallery, changes image and associated span text in a given frequency>
//----------------------------------- 
if  (i>pics.length-1) i=0;
img.src=pics[i].src;
document.getElementById(spaName).innerHTML=subs[i];
i++;
setTimeout("changeImg("+i+","+img.id+",'"+spaName+"', pics, subs,"+changeDelay+")", changeDelay);
}

function changeImg(i,img,spaName,picsList,subsList,changeDelay,imgPath) {
//-----------------------------------
//<created by rjm 08/22/05, dynamic pic gallery, changes image and associated span text in a given frequency>
//parameters
//i: the index of the pic/text to be shown
//img: handle to the img html tag that displays the image
//spaName: name of the span tag that displays the associated text
//picsList: list of pics to display separated by "|"
//subsList: list of subtitles texts to display in the span associated to each img in pics separated by "|"
//changeDelay: time between changes in ms
//</created by rjm 08/22/05, dynamic pic gallery, changes image and associated span text in a given frequency>
//----------------------------------- 
var pics=picsList.split("|");
var subs=subsList.split("|");
if  (i>pics.length-1) i=0;
img.src=imgPath+"/"+pics[i];
document.getElementById(spaName).innerHTML=subs[i];
i++;
setTimeout("changeImg("+i+","+img.id+",'"+spaName+"', '"+picsList+"', '"+subsList+"',"+changeDelay+",'"+imgPath+"')", changeDelay);
}

function findPosX(obj)
{
	var curleft = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curleft += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if (obj.x)
		curleft += obj.x;
	return curleft;
}

function findPosY(obj)
{
	var curtop = 0;
	if (obj.offsetParent)
	{
		while (obj.offsetParent)
		{
			curtop += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		curtop += obj.y;
	return curtop;
}

function centerInWindow(object)
 {
  object.style.left = (screen.width-object.style.width)/2;
  object.style.top = (screen.height-object.style.height)/2;
 }

