// JavaScript Document
var currentPage = "vision";
//var currentPage1 = "index";



var curPosi = 1;
var maxPosi = 7;




var ContentHeight = 100;
var TimeToSlide = 250.0;

var openAccordion = '';

function runAccordion(index)
{
  var nID = "Accordion" + index + "Content";
  if(openAccordion == nID)
    nID = '';
    
  setTimeout("animate(" + new Date().getTime() + "," + TimeToSlide + ",'" 
      + openAccordion + "','" + nID + "')", 33);
  
  openAccordion = nID;
}



function setPage()
{
	var cltWidth=document.body.clientWidth;
	cltWidth=((cltWidth-990)/2);
	document.getElementById("content").style.marginLeft =cltWidth + "px";
}

function mover(obj)
{
	
	document.getElementById(obj).style.backgroundImage = "url('images/" + obj + "_over.png')";
	
}
function mout(obj)
{
	
	document.getElementById(obj).style.backgroundImage = "url('images/" + obj + "_back.png')";
	
}
function setImg(obj)
{
	
	
	obj.style.cursor = "Pointer";
	obj.style.backgroundImage = "url('images/" + obj.id + "_over.jpg')";
	
}

function resetImg(obj)
{
	
	obj.style.backgroundImage = "url('images/" + obj.id + "_back.jpg')";
	
}


function setText(ucan)
{
//alert(ucan)
document.getElementById(ucan + "_button").className = "hover";
document.getElementById(ucan + "_button").style.backgroundColor = "#ffffff";
//alert(document.getElementById(ucan));
document.getElementById(ucan + "_button").style.cursor = "Pointer";
}

function resetText(ucan)
{

document.getElementById(ucan + "_button").className = "noeffect";
document.getElementById(ucan + "_button").style.backgroundColor = "#003468";
document.getElementById(ucan + "_button").style.backgroundImage = "url('images/" + ucan+ "_back.jpg')";
}

function setImg1(obj)
{
	
	document.getElementById(obj).style.backgroundImage = "url('images/" + obj + "_over.jpg')";
	
}


function resetImg1(obj)
{
	
	document.getElementById("about_button").style.backgroundImage = "url('images/" + ucan+ "_back.jpg')";
	
}



function openLink(obj)
{
	
	window.open(obj + ".html", "_self");
	
}
/*--------------------------------------------------------------------------------------
				INDEX TICKER
--------------------------------------------------------------------------------------*/
var curPos = 1;
var maxPos = 10;
var currentOpacity = 10;
var intervalId;
function movePrevious()
{
	
	curPos = curPos - 1;	
	if (curPos < 1)
	curPos = 10;
	//alert(curPos);
	window.clearInterval(intervalId)
	intervalId = window.setInterval("decreaseOpacity();", 50);
	
}

function moveNext()
{
	//alert(curPos);
	curPos = curPos + 1;
	
	if (curPos > maxPos)
	curPos = 1;
	
//alert(curPos);
	window.clearInterval(intervalId)
	intervalId = window.setInterval("decreaseOpacity();", 50);
	
}

function increaseOpacity()
{
	var slogan = document.getElementById("ticker");

	currentOpacity = currentOpacity + 1;
	
	if (currentOpacity == "10")
		slogan.style.opacity = "1";
	else
		slogan.style.opacity = "0." + currentOpacity;
	
	slogan.style.filter = "alpha(opacity=" + currentOpacity + "0)";
	
	if (currentOpacity == 10)
	{
	//	slogan.src = "images/ticker/" + curPos + ".png";
	window.clearInterval(intervalId);
	}


}


function decreaseOpacity()
{
		var slogan = document.getElementById("ticker");
	currentOpacity = currentOpacity - 1;
	
	if (currentOpacity == "10")
		slogan.style.opacity = "1";
	else
		slogan.style.opacity = "0." + currentOpacity;
	slogan.style.filter = "alpha(opacity=" + currentOpacity + "0)";
	
	if (currentOpacity == 0)
	{
		//alert(curPos);
	slogan.src = "images/ticker/"+curPos+".png";
	/*function openpage()
	{
		var newpos=curPos;
	if(newpos == 1)
	{
		alert('hello');
		window.open('hall_meb.html','_Self');
	}
	}*/
	window.clearInterval(intervalId);
	intervalId = window.setInterval("increaseOpacity();", 50);
	}
}

function openpage()
	{
		var newpos=curPos;
	if(newpos == 1)
	{
		//alert('hello');
		window.open('hall_meb.html','_self');
	}
	else if (newpos == 2)
		window.open('hall_mardy.html','_self');
	else if (newpos == 3)
		window.open('hall_vince.html','_self');
	else if (newpos == 4)
		window.open('hall_chris.html','_self');
	else if (newpos == 5)
		window.open('hall_simon.html','_self');
	else if (newpos == 6)
		window.open('hall_donna.html','_self');
	else if (newpos == 7)
		window.open('gen_jonah.html','_self');
	else if (newpos == 8)
		window.open('hall_linda.html','_self');
	else if (newpos == 9)
		window.open('hall_mark.html','_self');
	else if (newpos == 10)
		window.open('company.html','_self');
	
	
		
	}

function setOpacity()
{
	intervalId = window.setInterval("increaseOpacity();", 50);
}



/*--------------------------------------------------------------------------------------
				
--------------------------------------------------------------------------------------*/

function movePreviouspage()
{
	
	curPosi = curPosi - 1;	
	if (curPosi < 1)
	curPosi = 1;
	document.getElementById('pagination').style.backgroundImage = "url('images/paginate/sports/" + curPosi + ".png')";
	
}

function moveNextpage()
{
	
	curPosi = curPosi + 1;	
	if (curPosi > maxPosi)
	curPosi = 7;
	document.getElementById('pagination').style.backgroundImage = "url('images/paginate/sports/" + curPosi + ".png')";

}

/*--------------------------------------------------------------------------------------
				Hall of fame - pagination
--------------------------------------------------------------------------------------*/
var curPosit = 1;
var maxPosit = 3;



function movePreviouspage1()
{
	
	curPosit = curPosit - 1;
	//alert(curPosi);
	
	if (curPosit < 1)
	curPosit = 1;
	document.getElementById('talkingpage').style.backgroundImage = "url('images/paginate/" + curPosit + ".png')";
	
}

function moveNextpage1()
{
	
	curPosit = curPosit + 1;
	//alert(curPosit);
	
	if (curPosit > maxPosit)
	curPosit = 3;
	document.getElementById('talkingpage').style.backgroundImage = "url('images/paginate/" + curPosit + ".png')";

	
}

/*-------------------------------------------
	experts page - pagination
-------------------------------------------*/

var ecurPosit = 1;
var emaxPosit = 2;
function exp_movePreviouspage1()
{
	
	ecurPosit = ecurPosit - 1;
	//alert(curPosi);
	
	if (ecurPosit < 1)
	ecurPosit = 1;
	document.getElementById('talkingpage').style.backgroundImage = "url('images/paginate/" + ecurPosit + ".png')";
	
}

function exp_moveNextpage1()
{
	
	ecurPosit = ecurPosit + 1;
	//alert(curPosit);
	
	if (ecurPosit > emaxPosit)
	ecurPosit = 2;
	document.getElementById('talkingpage').style.backgroundImage = "url('images/paginate/" + ecurPosit + ".png')";

	
}




var currentPhoto = 1;
var total = 42;

function bigNext()
{
	//alert('coming');
	currentPhoto = currentPhoto + 1;
	//alert(currentPhoto);
	nextPhoto = "";
	
	if(currentPhoto >total)
	currentPhoto = 1;
	
	if ((currentPhoto % 6) == 0)
	nextPhoto = "sixth";
	else if ((currentPhoto % 6) == 5)
	nextPhoto = "fifth";
	else if ((currentPhoto % 6) == 4)
	nextPhoto = "fourth";
	else if ((currentPhoto % 6) == 3)
	nextPhoto = "third";
	else if ((currentPhoto % 6) == 2)
	nextPhoto = "second";
	else
	nextPhoto = "first";
	
}


function bigPrev()
{
	currentPhoto = currentPhoto - 1;
	nextPhoto = "";
	if(currentPhoto <1)
	currentPhoto = 20;
	
	if ((currentPhoto % 6) == 0)
	nextPhoto = "sixth";
	else if ((currentPhoto % 6) == 5)
	nextPhoto = "fifth";
	else if ((currentPhoto % 6) == 4)
	nextPhoto = "fourth";
	else if ((currentPhoto % 6) == 3)
	nextPhoto = "third";
	else if ((currentPhoto % 6) == 2)
	nextPhoto = "second";
	else
	nextPhoto = "first";
	
	document.getElementById('bigImage').style.backgroundImage = "url(images/Photos/Big/" + currentPhoto + "_" + nextPhoto + ".jpg)"; 
}





function animate(lastTick, timeLeft, closingId, openingId)
{  
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
  
  var opening = (openingId == '') ? null : document.getElementById(openingId);
  var closing = (closingId == '') ? null : document.getElementById(closingId);
 
  if(timeLeft <= elapsedTicks)
  {
    if(opening != null)
      opening.style.height = ContentHeight + 'px';
    
    if(closing != null)
    {
      closing.style.display = 'none';
      closing.style.height = '0px';
    }
    return;
  }
 
  timeLeft -= elapsedTicks;
  var newClosedHeight = Math.round((timeLeft/TimeToSlide) * ContentHeight);

  if(opening != null)
  {
    if(opening.style.display != 'block')
      opening.style.display = 'block';
    opening.style.height = (ContentHeight - newClosedHeight) + 'px';
  }
  
  if(closing != null)
    closing.style.height = newClosedHeight + 'px';

  setTimeout("animate(" + curTick + "," + timeLeft + ",'" 
      + closingId + "','" + openingId + "')", 33);
}





<!--88888888888888888888888888888888888888888888888888888888888888888888-->








function isubmit()
{
	if ((document.ucan.cname.value=="") || (document.ucan.email.value=="") || (document.ucan.comment.value==""))
		
		{
			
			alert("Please fill all required fields.");
		}	
		else
		{
		var emailID=document.ucan.email.value;
	
		if (echeck(emailID)==false)
		{
			
			document.ucan.email.focus();
			
			
		}
		else
		{
			
			
			document.ucan.submit();
			
			
		}
		
		}
}


function ireset()
{
document.ucan.cname.value="";

document.ucan.email.value="";	
document.ucan.comment.value="";
}



function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		
		if (str.indexOf(at)==-1){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("Invalid E-mail ID")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		    alert("Invalid E-mail ID")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		    alert("Invalid E-mail ID")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		    alert("Invalid E-mail ID")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		    alert("Invalid E-mail ID")
		    return false
		 }

 		 return true					
	}	
	
	
	
function rover(obj)
{

	obj.style.cursor='pointer';
	obj.style.backgroundImage="url('images/textpng/"+obj.id+"_over1.png')";

}

function rout(obj)
{
	obj.style.backgroundImage="url('images/textpng/"+obj.id+"_back.png')";
}	
