/***************************************************************
  Copyright 2005 John Healy
***************************************************************/

var thisPage;
arrow = new Image(51, 15); arrow.src = "/images/arrow.gif"; animArrow = new Image(51, 15); animArrow.src = "/images/anim_arrow.gif"; 
homeoff = new Image(26, 30); homeoff.src = "/images/menu/home_off.gif"; homeon = new Image(26, 30); homeon.src = "/images/menu/home_on.gif";
companyoff = new Image(44, 30); companyoff.src = "/images/menu/company_off.gif"; companyon = new Image(44, 30); companyon.src = "/images/menu/company_on.gif";
productsoff = new Image(49, 30); productsoff.src = "/images/menu/products_off.gif"; productson = new Image(49, 30); productson.src = "/images/menu/products_on.gif";
newsoff = new Image(73, 30); newsoff.src = "/images/menu/news_off.gif"; newson = new Image(73, 30); newson.src = "/images/menu/news_on.gif";
partnersoff = new Image(47, 30); partnersoff.src = "/images/menu/partners_off.gif"; partnerson = new Image(47, 30); partnerson.src = "/images/menu/partners_on.gif";
servicesoff = new Image(45, 30); servicesoff.src = "/images/menu/services_off.gif"; serviceson = new Image(45, 30); serviceson.src = "/images/menu/services_on.gif";
customersoff = new Image(56, 30); customersoff.src = "/images/menu/customers_off.gif"; customerson = new Image(56, 30); customerson.src = "/images/menu/customers_on.gif";
sitemapoff = new Image(40, 30); sitemapoff.src = "/images/menu/sitemap_off.gif"; sitemapon = new Image(40, 30); sitemapon.src = "/images/menu/sitemap_on.gif";
contactoff = new Image(58, 30); contactoff.src = "/images/menu/contact_off.gif"; contacton = new Image(58, 30); contacton.src = "/images/menu/contact_on.gif";

function rollon(imgImageName){
	var imgOn = eval(imgImageName + "on.src");
	document[imgImageName].src = imgOn;
}

function rolloff(imgImageName){
	if (thisPage != imgImageName){
		var imgOn = eval(imgImageName + "off.src");	
		document[imgImageName].src = imgOn;
	}
}


function animateArrow(imgImageName){
	document[imgImageName].src = animArrow.src;
}

function normalArrow(imgImageName){	
	document[imgImageName].src = arrow.src;
}


function highLightTableRow(tdName){
	tdName.style.backgroundColor="#D7D7Df";
}

function highLightMenuOption(tdName){
	tdName.style.backgroundColor="#D7D7D7";
	tdName.style.fontWeight="bold";
}

function highLightRightMenuOption(tdName){
	tdName.style.backgroundColor="#FFFFCC";
	tdName.style.fontWeight="bold";
}

function highLightNavOption(tdName){
	tdName.style.backgroundColor="#BCD6E9";
}

function normalMenuOption(tdName){
	tdName.style.backgroundColor="#FFFFFF";
	tdName.style.fontWeight="normal";
}

function normalNavOption(tdName){
	tdName.style.backgroundColor="#FFFFFF";
}

function showLayer(layerName){
	document.all[layerName].style.visibility = 'visible';
}

function hideLayer(){
	args = hideLayer.arguments;
	for (var i = 0; i < args.length; i++){
		document.all[args[i]].style.visibility = 'hidden';
	}
}

function changeMenuInfo(menuItem){
	document.all["menuInformation"].innerText = document.all[menuItem].innerText;	
}

function showTable(layerName){
	if(layerName == "None"){
		alert("Please select a valid item from the drop-down menu.");	
	}else{
		document.all[layerName].style.visibility = 'visible';
	}
}

function openWindow(strItemName, intWidth, intHeight){
	var WindowProperties
	winWidth    = intWidth;
	winHeight   = intHeight;	
	options     = "toolbar=no,directories=no,width=" + winWidth + ",height=" + winHeight;
	eventWindow = window.open(strItemName,"test", options)
}

function validateNewsletterSubmission(){
	txtFirstName = document.frmSubscribe.strFirstName.value;
	txtSurname = document.frmSubscribe.strSurname.value;
	txtCompany = document.frmSubscribe.strCompany.value;
	txtPosition = document.frmSubscribe.strPosition.value;
	txtPhone = document.frmSubscribe.strPhone.value;
	txtFax = document.frmSubscribe.strFax.value;
	txtEmail = document.frmSubscribe.strEmail.value; 

	if (txtFirstName == '' || txtSurname == '' || txtCompany == '' || txtPosition == '' || txtPhone == '' || txtFax == '' || txtEmail == ''){
		alert("Please fill in all the mandatory fields and resubmit.");
		blnStatus = false;
	}else{
		blnStatus = true;
	}
}

function validateLogin(strUserName, strPassword){
	if (strUserName == '' || strPassword == ''){
		alert("Sorry! You must enter a username and a password to proceed.");
		myStatus = false;
	}else{
		myStatus = true;
	}
}

function validateSendPage(){
	txtYourName = document.frmFriend.strYourName.value;
	txtYourEmailAddress = document.frmFriend.strYourEmailAddress.value;
	txtDestinationEmail = document.frmFriend.strDestinationEmail.value;

	if (txtYourName == '' || txtYourEmailAddress == '' || txtDestinationEmail == ''){
		alert("Please fill in all the mandatory fields and resubmit.");
		blnStatus = false;
	}else{
		blnStatus = true;
	}

}

function validateIncidentReport(){
	txtFirstName = document.frmSubscribe.strFirstName.value;
	txtSurname = document.frmSubscribe.strSurname.value;
	txtCompany = document.frmSubscribe.strCompany.value;
	txtPosition = document.frmSubscribe.strPosition.value;
	txtPhone = document.frmSubscribe.strPhone.value;
	txtFax = document.frmSubscribe.strFax.value;
	txtEmail = document.frmSubscribe.strEmail.value; 
	txtMobile = document.frmSubscribe.strMobile.value; 
	txtOperatingSystem = document.frmSubscribe.strOperatingSystem.value;
	txtOperatingSystemServiceLevel = document.frmSubscribe.strOperatingSystemServiceLevel.value;
	txtDatabaseType = document.frmSubscribe.strDatabaseType.value;
	txtDatabasePatchLevel = document.frmSubscribe.strDatabasePatchLevel.value;
	 ;
	txtWebServer = document.frmSubscribe.strWebServer.value;
	txtWebServerVersion = document.frmSubscribe.strWebServerVersion.value;

	if (txtFirstName == '' || txtSurname == '' || txtCompany == '' || txtPosition == '' || txtPhone == '' || txtFax == '' || txtEmail == '' || txtMobile == ''|| txtOperatingSystem == ''|| txtOperatingSystemServiceLevel == ''|| txtDatabaseType == ''|| txtDatabasePatchLevel == ''|| txtMiddleware == 'Please Select' || txtWebServer == ''|| txtWebServerVersion == ''){
		alert("Please fill in all the mandatory fields and resubmit.");
		blnStatus = false;
	}else{
		blnStatus = true;
	}
}

function validateChangeRequest(){
	txtFirstName = document.frmSubscribe.strFirstName.value;
	txtSurname = document.frmSubscribe.strSurname.value;
	txtCompany = document.frmSubscribe.strCompany.value;
	txtPosition = document.frmSubscribe.strPosition.value;
	txtPhone = document.frmSubscribe.strPhone.value;
	txtFax = document.frmSubscribe.strFax.value;
	txtEmail = document.frmSubscribe.strEmail.value; 
	txtMobile = document.frmSubscribe.strMobile.value; 
	Item = document.frmSubscribe.strProduct.selectedIndex;
	txtProduct = document.frmSubscribe.strProduct.options[Item].text;
	Item = document.frmSubscribe.strProductVersion.selectedIndex;
	txtProductVersion = document.frmSubscribe.strProductVersion.options[Item].text;
	txtChangeRequestTitle = document.frmSubscribe.strChangeRequestTitle.value;
	Item = document.frmSubscribe.strTypeOfChangeRequest.selectedIndex;
	txtTypeOfChangeRequest = document.frmSubscribe.strTypeOfChangeRequest.options[Item].text;
	Item = document.frmSubscribe.strPriority.selectedIndex;
	txtPriority = document.frmSubscribe.strPriority.options[Item].text;
	txtDateRequired = document.frmSubscribe.strDateRequired.value;
	txtDetailedDescriptionOfChangeRequested = document.frmSubscribe.txtDetailedDescriptionOfChangeRequested.value;
	
	if (txtFirstName == '' || txtSurname == '' || txtCompany == '' || txtPosition == '' || txtPhone == '' || txtFax == '' || txtEmail == '' || txtMobile == ''|| txtProduct == 'Please Select'|| txtProductVersion == 'Please Select'|| txtChangeRequestTitle == ''|| txtTypeOfChangeRequest == 'Please Select'|| txtPriority == 'Please Select' || txtDateRequired == ''|| txtDetailedDescriptionOfChangeRequested == ''){
		alert("Please fill in all the mandatory fields and resubmit.");
		blnStatus = false;
	}else{
		blnStatus = true;
	}
}