// home page
function scrollIndexPage(sScrollFrom, sScrollTo)
{
document.getElementById(sScrollFrom).style.display='none';
document.getElementById(sScrollTo).style.display='';
}


// portfolio pages
function changePortfolioThumbnail(sThumbnailText, sImageName) {
if (sThumbnailText !='') {
var elemText = document.getElementById('portfolioimagetext');
elemText.innerHTML=sThumbnailText;
}
var elemLargeImage = document.getElementById('largeimageimg');
elemLargeImage.src=sImageName;
}

function highlightPortfolioLink(sClientName) {
var sLinkID = sClientName + 'link';
document.getElementById(sLinkID).src='portfoliolink' + sClientName + 'bold.gif';
}

function lowlightPortfolioLink(sClientName) {
var sLinkID = sClientName + 'link';
document.getElementById(sLinkID).src='portfoliolink' + sClientName + '.gif';
}

function setBloatedDiv(thumbID) {
document.getElementById('bloated' + thumbID).style.display='';
document.getElementById('bloated' + thumbID).style.cursor='pointer';

document.getElementById(thumbID).style.display='none';
// clear all bloated divs in case MouseOut hasn't fired
if (thumbID != 'thumb1') {
	clearBloatedDiv('bloatedthumb1');
	setThumbDiv('thumb1');
}
if (thumbID != 'thumb2') {
	clearBloatedDiv('bloatedthumb2');
	setThumbDiv('thumb2');
}
if (thumbID != 'thumb3') {
	clearBloatedDiv('bloatedthumb3');
	setThumbDiv('thumb3');
}
if (thumbID != 'thumb4') {
	clearBloatedDiv('bloatedthumb4');
	setThumbDiv('thumb4');
}
if (thumbID != 'thumb5') {
	clearBloatedDiv('bloatedthumb5');
	setThumbDiv('thumb5');
}
if (thumbID != 'thumb6') {
	clearBloatedDiv('bloatedthumb6');
	setThumbDiv('thumb6');
}
if (thumbID != 'thumb7') {
	clearBloatedDiv('bloatedthumb7');
	setThumbDiv('thumb7');
}
if (thumbID != 'thumb8') {
	clearBloatedDiv('bloatedthumb8');
	setThumbDiv('thumb8');
}
if (thumbID != 'thumb9') {
	clearBloatedDiv('bloatedthumb9');
	setThumbDiv('thumb9');
}
}

function clearBloatedDiv(bloatedThumbID) {
// check that element exists as different pages have different numbers of thumbnails
 if (document.getElementById(bloatedThumbID) !=null) {
	document.getElementById(bloatedThumbID).style.display='none';

}
}

function setThumbDiv(thumbID) {
// check that element exists as different pages have different numbers of thumbnails
 if (document.getElementById(thumbID) !=null) {
	document.getElementById(thumbID).style.display='';
}
}


// contact page
function validateForm() {
// Name and Contact Details required fields
if (document.getElementById('txtContactDetails').value != '' && document.getElementById('txtName').value !='') 
{
	return true;
}
else {
	alert('Please complete both Name and Contact Details. Many thanks.');
	return false;
}
}

