function highlightImage(cell){
	cell.style.background="#FF9900";
	cell.style.cursor="hand";
}

function restoreImage(cell){
	cell.style.background="#123456";
}

function openAlbumImage(img){
	document.all.imagebox.style.background = "url('"+img+"') no-repeat center middle;"
}

function buttonOver(b){
	b.style.backgroundColor='#666666';
	b.style.background='url(http://www.ivsweb.org/images/menu/black/mbgo.png)';
}

function buttonOut(b){
	b.style.backgroundColor='#333333';
	b.style.background='url(http://www.ivsweb.org/images/menu/black/mbg.png)';
}

function validateAndSubmit(formName, first, second, third, fourth){
	if(document.all(first).value == ""){
		document.all(first).focus();
	}else if(document.all(second).value == ""){
		document.all(second).focus();
	}else if(document.all(third).value == ""){
		document.all(third).focus();
	}else if(document.all(fourth).value == ""){
		document.all(fourth).focus();
	}else{
		document.all(formName).submit();
	}
}

function validateLogin(formName, first, second){
	if(document.all(first).value == ""){
		document.all(first).focus();
	}else if(document.all(second).value == ""){
		document.all(second).focus();
	}else{
		document.all(formName).submit();
	}
}

function validateLoginCreate(formName, first, second, third, fourth, fifth, sixth, seventh, eighth){
	if(document.all(first).value == ""){
		document.all(first).focus();
	}else if(document.all(second).value == ""){
		document.all(second).focus();
	}else if(document.all(third).value == ""){
		document.all(third).focus();
	}else if(document.all(third).value != document.all(second).value){
		document.all(third).value = "";
		document.all(second).value = "";
		document.all(second).focus();
	}else if(document.all(fourth).value == ""){
		document.all(fourth).focus();
	}else if(document.all(fifth).value == ""){
		document.all(fifth).focus();
	}else if(document.all(sixth).value == ""){
		document.all(sixth).focus();
	}else if(document.all(seventh).value == ""){
		document.all(seventh).focus();
	}else if(document.all(eighth).value == ""){
		document.all(eighth).focus();
	}else{
		document.all(formName).submit();
	}
}

function gotoURL(prefix){
	var chapter = document.all.chapter.selectedIndex + 1;
	document.all.page.value=chapter;
	if (chapter < 10)
	{
		chapter = '0' + chapter;
	}
	
	var url = prefix + chapter + ".jsp";
	//alert(url);
	document.all.LifeHistoryOfBhagavan.action = url;
	document.all.LifeHistoryOfBhagavan.submit();
}