﻿/* Copyright Commcam Limited 2008. All rights reserved. (See licence/licence.txt) */
function login()
{
	var objForm = document.getElementById("loginForm");
	var objDiv;
	if (validateForm(objForm))
	{
		var objAjax = new CAjax();

		if (objAjax.open("admin/login.php?username=" + getFormValue("username") + "&password=" + getFormValue("password"), true))
		{
			objDiv = document.getElementById("loginMessage");
			objDiv.innerHTML = objAjax.getResponse();

			var arrError = document.getElementsByTagName("loginError");
			
			if (arrError.length == 0)
			{
				window.open("main.php", "portal");
			}
		}
	}
}

function osullivansOnFirstLoad(bLoggedIn)
{
	bResizeWindow = false;
	onFirstLoad();
	if (bLoggedIn)
	{
		innerContentUpdate("styles/osullivans/static/_loggedin.html");
	}
	else
	{
		innerContentUpdate("styles/osullivans/static/_default.html");
	}		
}

function showProfile()
{
	innerContentUpdate("styles/osullivans/static/_profile.html");
}

function showProductStandards()
{
	innerContentUpdate("styles/osullivans/static/_productStandards.html");
}


function showSuppliers()
{
	innerContentUpdate("styles/osullivans/static/_suppliers.html");
}

function showServices()
{
	innerContentUpdate("styles/osullivans/static/_services.html");
}

function showNews()
{
	innerContentUpdate("styles/osullivans/static/_news.html");
}

function showEvents()
{
	innerContentUpdate("styles/osullivans/static/_events.html");
}


function showTraining()
{
	innerContentUpdate("styles/osullivans/static/_training.html");
}

function showAdvice()
{
	innerContentUpdate("styles/osullivans/static/_advice.html");
}

function showChoosingProduct()
{
	innerContentUpdate("styles/osullivans/static/_choosing.html");
}

function showBranch()
{
	innerContentUpdate("styles/osullivans/static/_branch.html");
}
function showTerms()
{
	innerContentUpdate("styles/osullivans/static/_terms.html");
}

function showVacancies()
{
	innerContentUpdate("styles/osullivans/static/_vacancies.html");
}




