var selectedPreview=1;
var marquee1;
var marquee2;
var speed;
var height;
var m;
var n;


function getObj(obj_id)
{
	return document.getElementById(obj_id);
}

function showLayer(obj_id)
{
	getObj(obj_id).style.display='';
}

function hideLayer(obj_id)
{
	getObj(obj_id).style.display='none';
}

function toogleLayerVisibility(obj_id)
{	
	if(getObj(obj_id).style.display=='none')
	{
		showLayer(obj_id);
		
		getObj(obj_id).scrollIntoView(false);
	}
	else
	{
		hideLayer(obj_id);
	}
}

function switchPic(picObj,newSrc,newPicName)
{
	picObj.src=newSrc;
	
	picObj.title=newPicName;
	
	picObj.alt=newPicName+' - loading...';
}

function switchImg(picObj,newSrc)
{
	picObj.src=newSrc;		
}

function openLoadingMsg(loadingCellRow,loadingCellObj,nowLoadingGIFsrc)
{
	loadingCellRow.style.display='';
	
	loadingCellObj.innerHTML='<img align="center" border="0" src="'+nowLoadingGIFsrc+'" /><br />Loading image, please wait...';
}

function closeLoadingMsg(loadingCellRow,loadingCellObj)
{
	loadingCellRow.style.display='none';
	
	loadingCellObj.innerHTML='';
}

function showRow(rowObj)
{
	rowObj.style.display='';
}

function preLoad(imgSrc)
{
	var imgObj = new Image();
	
	imgObj.src=imgSrc; 	
}

function setScrollVars(heightValue,speedValue,marquee1Name,marquee2Name)
{
	height=heightValue;
	speed=speedValue;
	marquee1=getObj(marquee1Name);
	marquee2=getObj(marquee2Name);
	m=0;
	n=height;
}
	  
function scrollPics() 
{
	marquee1.style.top=m+'px';
	marquee2.style.top=n+'px';
	m--;
	n--;
	
	if(m==-height)
	{
		m=height;
	}
	if(n==-height) 
	{
		n=height;
	}
	setTimeout('scrollPics()',speed);
}
