function mouseOver(obj,fixedLink) {
	if ((fixedLink == 'Automotive') || (fixedLink == 'diy') || (fixedLink == 'woodwork')) {
		fixedLink = 'products';
	}
	
	var fixedObj = this.document.getElementById(fixedLink);
	if (fixedObj != obj) {
		obj.className = 'navigLightShade';
	}
	return true;
}

function mouseOut(obj,fixedLink) {
	if ((fixedLink == 'Automotive') || (fixedLink == 'diy') || (fixedLink == 'woodwork')) {
		fixedLink = 'products';
	}
	
	var fixedObj = this.document.getElementById(fixedLink);
	if (fixedObj != obj) {
		obj.className = 'navigMediumShade';
	}
	return true;
}

function mouseClick(obj,fixedLink) {
	if ((fixedLink == 'Automotive') || (fixedLink == 'diy') || (fixedLink == 'woodwork')) {
		fixedLink = 'products';
	}
	
	var fixedObj = this.document.getElementById(fixedLink);
	if (fixedObj != obj) {
		if(obj.id=='home') {
			this.location = rootRef+'index.html';
		}
		else if(obj.id=='products') {
			this.location = rootRef+'products.html';
		}
		else if(obj.id=='enquire') {
			this.location = rootRef+'enquire.html';
		}
		else if(obj.id=='about') {
			this.location = rootRef+'about.html';
		}
	}
	return true;
}

function setFixedLink(pageName) {
	if ((pageName == 'Automotive') || (pageName == 'diy') || (pageName == 'woodwork')) {
		pageName = 'products';
	}
	
	var docObj = this.document.getElementById(pageName);
	if (docObj != null) {
		docObj.className = 'navigDarkShade';
	}
}

function composeNagivationBar(currentPage) {
	var htmlStr = '';
	htmlStr+= '<table align="center" width="762" border="0" cellpadding="0" cellspacing="0">';
	htmlStr+= '	<tr>'
	htmlStr+= '		<!-- Navigation bar -->'
	htmlStr+= '		<td id="home" class="navigMediumShade" width="112" height="19" onmouseover="mouseOver(this,\''+currentPage+'\');" onmouseout="mouseOut(this,\''+currentPage+'\');" onclick="mouseClick(this,\''+currentPage+'\');">Home</td>';
	htmlStr+= '		<td class="navigSpacer" width="3" height="19"></td>'
	htmlStr+= '		<td id="products" class="navigMediumShade" width="112" height="19" onmouseover="mouseOver(this,\''+currentPage+'\');" onmouseout="mouseOut(this,\''+currentPage+'\');" onclick="mouseClick(this,\''+currentPage+'\');">Products</td>';
	htmlStr+= '		<td class="navigSpacer" width="3" height="19"></td>'
	htmlStr+= '		<td id="enquire" class="navigMediumShade" width="112" height="19" onmouseover="mouseOver(this,\''+currentPage+'\');" onmouseout="mouseOut(this,\''+currentPage+'\');" onclick="mouseClick(this,\''+currentPage+'\');">Enquire</td>';
	htmlStr+= '		<td class="navigSpacer" width="3" height="19"></td>'
	htmlStr+= '		<td id="about" class="navigMediumShade" width="112" height="19" onmouseover="mouseOver(this,\''+currentPage+'\');" onmouseout="mouseOut(this,\''+currentPage+'\');" onclick="mouseClick(this,\''+currentPage+'\');">About Us</td>';
	htmlStr+= '		<td class="navigSpacer" width="305" height="19"></td>'
	htmlStr+= '	</tr>'
	htmlStr+= '</table>'
	this.document.write(htmlStr);
	setFixedLink(currentPage);
	return true;
}

function composeSloganBar() {
	var htmlStr = '';
	htmlStr+= '<table align="center" width="762" border="0" cellpadding="0" cellspacing="0">';
	htmlStr+= ' <tr><td>';
	htmlStr+= '		<table align="left" width="762" border="0" cellpadding="0" cellspacing="0">';
	htmlStr+= '			<tr>';
	htmlStr+= '				<!-- Logo Banner -->';
	htmlStr+= '				<td class="darkShade" width="23" height="44"></td>';
	htmlStr+= '				<td class="darkShade"><img src="'+rootRef+'images/slogan/coName.gif" width="281" height="44" border="0"></td>';
	htmlStr+= '				<td class="darkShade" width="458" height="44"></td>';
	htmlStr+= '			</tr>';
	htmlStr+= '		</table>';
	htmlStr+= '	</td></tr>';
	htmlStr+= '	<tr><td>';
	htmlStr+= '		<table align="center" width="762" border="0" cellpadding="0" cellspacing="0">';
	htmlStr+= '			<tr>';
	htmlStr+= '				<!-- Slogan -->';
	htmlStr+= '				<td class="lightShade"><img src="'+rootRef+'images/slogan/splash_1.gif" width="55" height="103" border="0"></td>';
	htmlStr+= '				<td class="lightShade"><img src="'+rootRef+'images/slogan/splash_2.gif" width="57" height="103" border="0"></td>';
	htmlStr+= '				<td class="lightShade"><img src="'+rootRef+'images/slogan/splash_3.gif" width="59" height="103" border="0"></td>';
	htmlStr+= '				<td class="lightShade"><img src="'+rootRef+'images/slogan/splash_4.gif" width="59" height="103" border="0"></td>';
	htmlStr+= '				<td class="lightShade"><img src="'+rootRef+'images/slogan/splash_5.gif" width="84" height="103" border="0"></td>';
	htmlStr+= '				<td class="lightShade">';
	htmlStr+= '					<table align="center" width="448" border="0" cellpadding="0" cellspacing="7">';
	htmlStr+= '					<tr>';
	htmlStr+= '						<td class="sloganTextArea">';
	htmlStr+= '							Distributors of products<br>';
	htmlStr+= '							for automotive repair, D.I.Y. and woodwork trades';
	htmlStr+= '						</td>';
	htmlStr+= '					</tr>';
	htmlStr+= '					<tr>';
	htmlStr+= '						<td class="addressTextArea">';
	htmlStr+= '							Msida Valley Road, B’kara, BKR 10 Malta.<br>';
	htmlStr+= '							<b>Tel:</b> (+356) 21 487584 &#9642; <b>Fax:</b> (+356) 21 486979 &#9642; <b>E-mail:</b> info@ultrapaints.com';
	htmlStr+= '						</td>';
	htmlStr+= '					</tr>';
	htmlStr+= '					</table>';
	htmlStr+= '				</td>';
	htmlStr+= '			</tr>';
	htmlStr+= '		</table>';
	htmlStr+= '	</td></tr>';
	htmlStr+= '	<tr><td>';
	htmlStr+= '		<table align="center" width="762" border="0" cellpadding="0" cellspacing="0">';
	htmlStr+= '			<tr>';
	htmlStr+= '				<!-- Closing Bar -->';
	htmlStr+= '				<td class="mediumShade" width="762" height="4"></td>';
	htmlStr+= '			</tr>';
	htmlStr+= '		</table>';
	htmlStr+= '	</td></tr>';
  	htmlStr+= '</table>';
	this.document.write(htmlStr);
  	return true;
}

function composeBottomNavigation() {
	var htmlStr = '';
	htmlStr+= '<table align="center" width="762" border="0" cellpadding="0" cellspacing="0">';
	htmlStr+= '	<tr>';
	htmlStr+= '	<!-- Bottom Nagivation -->';
	htmlStr+= '		<td class="lightShade" width="762" height="28" align="center">';
	htmlStr+= '			<a href="'+rootRef+'index.html" title="Home">Home</a> |';
	htmlStr+= '			<a href="'+rootRef+'products.html" title="Products">Products</a> |';
	htmlStr+= '			<a href="'+rootRef+'enquire.html" title="Enquire">Enquire</a> |';
	htmlStr+= '			<a href="'+rootRef+'about.html" title="About Us">About Us</a>';
	htmlStr+= '		</td>';
	htmlStr+= '	</tr>';
	htmlStr+= '	<tr>';
	htmlStr+= '		<!-- Copyrights -->';
	htmlStr+= '		<td class="navigText" width="762" height="17">© 2005 Galdes & Mamo Ltd.</td>';
	htmlStr+= '	</tr>';
	htmlStr+= '</table>';
	this.document.write(htmlStr);
	return true;
}

function composeProductSidePanel(category,imageSrc) {
	if (category == 'a') {
		category = 'Automotive Products';
	}
	else if (category == 'd') {
		category = 'D.I.Y. Products';
	}
	else if (category == 'w') {
		category = 'Woodwork Products';
	}
	
	var htmlStr = '';
	htmlStr+= '<td class="clearShade" valign="top" width="202" background="../images/common/guide_line.gif">';
	htmlStr+= '	<table width="202" border="0" align="center" cellpadding="0" cellspacing="15">';
	htmlStr+= '		<tr><td class="clearShade" align="center">';
	if (imageSrc!='') {
		htmlStr+= '			<img src="../images/allProducts/logos/'+imageSrc+'">';
		htmlStr+= '			<br><br>';
	}
	htmlStr+= '			<div class="guideTextAreaTitle">'+category+'</div>';
	htmlStr+= '			<img src="../images/allProducts/gmBox.gif">';
	htmlStr+= '		</td></tr>';
	htmlStr+= '	</table>';
	htmlStr+= '</td>';
	this.document.write(htmlStr);
	return true;
}

function composeProductTitle(category) {
	var urlquery=location.href.split("?");
	var idx = urlquery[1];
	this.document.write('<div class="productTitle">');
		if (category == 'a') {this.document.write(getProductName_A(idx));}
		else if (category == 'd') {this.document.write(getProductName_D(idx));}
		else if (category == 'w') {this.document.write(getProductName_W(idx));}
	this.document.write('</div>');
	this.document.write('<div class="productDescription">');
		if (category == 'a') {this.document.write(getProductDesc_A(idx));}
		else if (category == 'd') {this.document.write(getProductDesc_D(idx));}
		else if (category == 'w') {this.document.write(getProductDesc_W(idx));}
	this.document.write('</div>');
	return true;
}

function composeProductEnq(category) {
	var linkRef = '';
	var linkTxt = '';
	if (category == 'a') {
		linkRef = '_allAutomotive.html';
		linkTxt = 'Automotive';
	}
	else if (category == 'd') {
		linkRef = '_allDIY.html';
		linkTxt = 'D.I.Y.';
	}
	else if (category == 'w') {
		linkRef = '_allWoodwork.html';
		linkTxt = 'Woodwork';
	}
	this.document.write('<a href="../enquire.html">&#9642; Enquire about this product &#9642;</a><br>');
	this.document.write('<a class="productTitleLink" style="color : #BBBBBB;" href="'+linkRef+'">[Back to '+linkTxt+' list]</a>');
	return true;				
}

function composeExternalLink(category) {
	var urlquery=location.href.split("?");
	var idx = urlquery[1];
	
	var productName = '';
	var linkRef = '';
	if (category == 'a') {
		productName = getProductName_A(idx);
		linkRef = getProductLinkRef_A(idx);
	}
	else if (category == 'd') {
		productName = getProductName_D(idx);
		linkRef = getProductLinkRef_D(idx);
	}
	else if (category == 'w') {
		productName = getProductName_W(idx);
		linkRef = getProductLinkRef_W(idx);
	}
	
	this.document.write('<div class="productDescription">');
	if (linkRef != '') {
		this.document.write(' <a href="'+linkRef+'" target="_blank">Visit '+productName+' online</a> ');
	}
	else {
		this.document.write(' ');
	}
	this.document.write('</div>');
	return true;	
}