
//function to rotate children images on ua529home JSP

function rotateHome(id) {
var kid;
var nu;
nu=Math.random(); 
nu=nu*1000;

kid=nu % 4;
kid=Math.floor(kid);

//alert(kid);
	if (kid==0)
	{
		//alert("hi");
		document.getElementById(id).className="homeHdrImg4";
	}
	
	if (kid==1)
	{
		document.getElementById(id).className="homeHdrImg1";
	}

	if (kid==2)
	{
		document.getElementById(id).className="homeHdrImg2";
	}	
	
	if (kid==3)
	{
		document.getElementById(id).className="homeHdrImg3";
	}	

}


// function to rotate children images on interior ua529 JSPs
function rotateInterior(id, id2) {
var kid;
var nu;
nu=Math.random(); 
nu=nu*1000;

kid=nu % 4;
kid=Math.floor(kid);

//alert(kid);
	if (kid==0)
	{
		//alert("hi");
		document.getElementById(id).className="interiorHdrImg4A";
		document.getElementById(id2).className="interiorHdrImg4B";
	}
	
	if (kid==1)
	{
		document.getElementById(id).className="interiorHdrImg1A";
		document.getElementById(id2).className="interiorHdrImg1B";
	}

	if (kid==2)
	{
		document.getElementById(id).className="interiorHdrImg2A";
		document.getElementById(id2).className="interiorHdrImg2B";
	}	
	
	if (kid==3)
	{
		document.getElementById(id).className="interiorHdrImg3A";
		document.getElementById(id2).className="interiorHdrImg3B";
	}	

}




//function used to remove search magnifying glass background image when input field has focus
function bgChange(bg)
{
document.getElementById('searchInput').style.background="url(" + bg +") no-repeat";
document.getElementById('searchInput').style.backgroundColor="fff";
}


//function used to expand/collapse left-hand nav options
function toggle(item) {
 obj=document.getElementById(item);
 visible=(obj.style.display!="none")
 key=document.getElementById("x" + item);
 if (visible)
 {
  obj.style.display="none";

 }
 else 
 {
  obj.style.display="block";
 }
}

function toggleSwap(item, myButton) {
 myButton=document.getElementById(myButton);	
 obj=document.getElementById(item);
 visible=(obj.style.display!="none")
 key=document.getElementById("x" + item);
 if (visible)
 {
  obj.style.display="none";
    swapImage(myButton, "plus");

 }
 else 
 {
  obj.style.display="block";
    swapImage(myButton, "minus");

 }
}



function Expand() {
divs=document.getElementsByTagName("DIV");
for (i=0 ; i < divs.length;i++) {
divs[i].style.display="block";
key=document.getElementById("x" + divs[i].id);

}
}

function Collapse() {
divs=document.getElementsByTagName("DIV");
for (i=0; i < divs.length;i++) {
divs[i].style.display="none";
key=document.getElementById("x" + divs[i].id);

}
}

//function to swap an image based on its current state

function swapImage(myImage, state) {
	//alert("in");

	if (state == "minus") {
		//alert("show minus");
		myImage.src = '/529common/images/minus.jpg';
	}

	else {
		//alert("show plus");
		myImage.src = '/529common/images/plus.jpg';
	}
}

var ImagePool = new Array();
ImagePool[0] = "<IMG SRC=/529common/images/rightCol1.jpg>";
ImagePool[1] = "<IMG SRC=/529common/images/rightCol2.jpg>";
ImagePool[2] = "<IMG SRC=/529common/images/rightCol3.jpg>";
ImagePool[3] = "<IMG SRC=/529common/images/rightCol4.jpg>";
ImagePool[4] = "<IMG SRC=/529common/images/rightCol5.jpg>";		
ImagePool[5] = "<IMG SRC=/529common/images/rightCol6.jpg>";	



function rotateRightImage() {
	var img;
	var nu;
	nu=Math.random(); 
	nu=nu*1000;

	img=nu % 6;
	img=Math.floor(img);
	
	document.write(ImagePool[img]);
}

var txtArray = new Array();
txtArray[0] = "Any U.S. citizen or resident alien can contribute to an account in the UA College Savings Plan.";
txtArray[1] = "A UA College Savings Plan account can be used at almost any college, university, or technical school in the U.S.";
txtArray[2] = "You can designate half of your PFD as a yearly contribution to your UA College Savings Plan account.";
txtArray[3] = "Grandparents, aunts, uncles, cousins and even family friends can contribute. Even if they live outside Alaska.<br><br><a href='/public/ua529/xStaticFiles/PDFs/gift_contribution_slip.pdf' target='_blank'>Gift Contribution Slip</a>";
txtArray[4] = "It's not just tuition. A UA College Savings Plan Account can be used for books, room and board and many other college-related expenses.";
txtArray[5] = "That if you're planning to further your education, you can open an UA College Savings Plan Account for yourself.";


function rotateRightText() {
	var txt;
	var nu;
	nu=Math.random(); 
	nu=nu*1000;

	txt=nu % 6;
	txt=Math.floor(txt);
		
	document.write(txtArray[txt]);

}

var newwindow;
function popWin(url, height, width)
{
   //add origin tag

	newwindow=window.open(url,'popup','scrollbars=yes,status=yes,resizable=yes,toolbar=yes,location=yes,addressbar=yes,menubar=yes,height=' + height + ',width=' + width +'');
	if (window.focus) {newwindow.focus()}
}
