var conTent=0;
var weWant=0;
//If you want it to move faster you can set this lower:
var speed=40;
//Sets variables to keep track of what's happening
var loop, timer
//Calls the scrolling functions. Also checks whether the page is loaded or not.
function scroll(weWant,speed){
	if(loaded){
oCont=eval("oCont"+weWant);
oText=eval("oText"+weWant);
conTent=eval("(-oText"+weWant+".h+oCont"+weWant+".cb)");
//alert(-oText.h+oCont.cb)

		loop=true;
		if(speed>0) oText.down(speed)
		else oText.up(speed)
	}
}
//Stops the scrolling (called on mouseout)
function noScroll(){
	loop=false;
	clearTimeout(timer);
	weWant=0;
}


function get_random(totalNo)
{
	if (Math.random && Math.round)
	{
	var randNum= Math.round(Math.random()*(totalNo-1));
	randNum+=1;
	return randNum;
	}else{
	today= new Date();
	hours= today.getHours();
	mins=   today.getMinutes();
	secn=  today.getSeconds();
	if (hours==19)
	hours=18;
	var randNum= (((hours+1)*(mins+1)*secn)%totalNo)+1;
	return randNum;
	}
}


function randomImage()
{
	if (document.images){
	var selectedImg= get_random(6);  
	selectedImg--;

	var imageNo= new Array(3) 
	//imageNo[0]="images/homepage/1_adelie_penguins_1500x387.jpg";  
	//imageNo[1]="images/homepage/1_antarctica_1500x387.jpg";  
	imageNo[0]="images/homepage/1_EqEsc_Beach_1500x387.jpg";
	imageNo[1]="images/homepage/1_JaggedGlobe3_1500x387.jpg"; 
	imageNo[2]="images/homepage/2433286_1500.jpg";
	imageNo[3]="images/homepage/2715944a_1500.jpg";
	imageNo[4]="images/homepage/3049395_1500.jpg";
	imageNo[5]="images/homepage/2235389_1500.jpg";
	
	
	var captionText= new Array(3) 
	//captionText[0] = "   Courtesy of Hurtigruten";
	//captionText[1] = "   Courtesy of Hurtigruten";
	captionText[0] = "   Courtesy of Equestrian Events";
	captionText[1] = "   Courtesy of Jagged Globe";
	//captionText[0] = "   ";
	//captionText[1] = "   ";
	captionText[2] = "   ";
	captionText[3] = "   ";
	captionText[4] = "   ";
	captionText[5] = "   ";
	captionText[6] = "   ";
	
	
			var r=document.getElementById('contentHomepageRight');
			r.style.backgroundRepeat="no-repeat";
			r.style.backgroundImage="url('" + imageNo[selectedImg] + "')";

			if(document.all){
		    	r.innerText = captionText[selectedImg];
			} else{
			    r.textContent = captionText[selectedImg];
			}


 }
}

 function Submit()
 {
   document.myform.submit();
 }
