function HomePageMore(){
	if(document.getElementById("homepagecontent")){
		var homeContent1 = document.getElementById("homecontent1");
		var homeContent2 = document.getElementById("homecontent2");
		var homePageContact = document.getElementById("homepagecontact");
		homeContent1.style.display = "none";
		homeContent2.style.display = "block";						
		homePageContact.style.display = "none";	
	}

}

function HomePageBack(){
	if(document.getElementById("homepagecontent")){
		var homeContent1 = document.getElementById("homecontent1");
		var homeContent2 = document.getElementById("homecontent2");
		var homePageContact = document.getElementById("homepagecontact");
		homeContent1.style.display = "block";
		homeContent2.style.display = "none";
		homePageContact.style.display = "block";							
	}
}

function NextPage(){
	if(document.getElementById("section1content") && document.getElementById("section2content")){
		document.getElementById("section1content").style.display = 'none';
		document.getElementById("section2content").style.display = 'block';
	}
}

function PreviousPage(){
	if(document.getElementById("section1content") && document.getElementById("section2content")){
		document.getElementById("section1content").style.display = 'block';
		document.getElementById("section2content").style.display = 'none';
	}
}

function fixMenus(){
	//just removes the last commas from the list of menu items. both the main and sub menu
	if(document.getElementById){
		if(document.getElementById("topmenu")){
			var topMenuEl = document.getElementById("topmenu");
			var topLinks = topMenuEl.getElementsByTagName("a");
			var numberOfTopLinks = topLinks.length;
			var lastAnchorText = topLinks[numberOfTopLinks-1].innerHTML;
			lastAnchorText = lastAnchorText.replace(",","");
			topLinks[numberOfTopLinks-1].innerHTML = lastAnchorText;
		}
		
		if(document.getElementById("submenu")){
			var menu2El = document.getElementById("submenu")
			var menu2Links = menu2El.getElementsByTagName("a");
			if(menu2Links.length != 0){
				var numberOfLinks = menu2Links.length;
				if (document.getElementById('secback')!=null){
				    var lastAnchorText = menu2Links[numberOfLinks-2].innerHTML;
				    lastAnchorText = lastAnchorText.replace(",","");
				    menu2Links[numberOfLinks-2].innerHTML = lastAnchorText;	
				}
				else{
				    var lastAnchorText = menu2Links[numberOfLinks-1].innerHTML;
				    lastAnchorText = lastAnchorText.replace(",","");
				    menu2Links[numberOfLinks-1].innerHTML = lastAnchorText;	
				}
			}
		}
	}

}

function ClearPasswordInput(target, defaultval){
	if(target.value == defaultval){				
		var passInp = document.createElement('input');
		passInp.setAttribute('value','');
		passInp.style.color = "#000";
		passInp.setAttribute('type','password');
		passInp.setAttribute('name',target.getAttribute('name'));
		passInp.setAttribute('size',target.getAttribute('size'));
		passInp.setAttribute('id',target.getAttribute('id'));
		passInp.setAttribute('onblur',target.getAttribute('onblur'));
		passInp.setAttribute('onfocus',target.getAttribute('onfocus'));
		target.parentNode.replaceChild(passInp,target);
		target = document.getElementById('password');
		setTimeout("document.getElementById('password').focus();", 10);		
	}
}

function ReplacePasswordInputPrompt(target,defaultval){
	if(target.value == ""){
		var passInp = document.createElement('input');
		passInp.setAttribute('value',defaultval);
		passInp.style.color = "#ccc";
		passInp.setAttribute('type','text');
		passInp.setAttribute('name',target.getAttribute('name'));
		passInp.setAttribute('size',target.getAttribute('size'));
		passInp.setAttribute('id',target.getAttribute('id'));
		passInp.setAttribute('onblur',target.getAttribute('onblur'));
		passInp.setAttribute('onfocus',target.getAttribute('onfocus'));
		target.parentNode.replaceChild(passInp,target);
	}
}	

function ClearTextInput(target, defaultval){
	if(target.value == defaultval){
		target.value = "";
		target.style.color = "#000";
	}
}

function ReplaceTextInputPrompt(target,defaultval){
	if(target.value == ""){
		target.value = defaultval;
		target.style.color = "#B7B7B7";
	}
}
