/************************************************
  
  Site Name: SALES MARKETING

************************************************/
function smartRollover() {
	if(document.getElementsByTagName) {
		var images = document.getElementsByTagName("img");
		for(var i=0; i < images.length; i++) {
			if(images[i].getAttribute("src").match("_def."))
			{
				images[i].onmouseover = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_def.", "_ovr."));
				}
				images[i].onmouseout = function() {
					this.setAttribute("src", this.getAttribute("src").replace("_ovr.", "_def."));
				}
			}
		}
		var images = document.getElementsByTagName("input");
		for(var n=0; n < images.length; n++) {
			if(images[n].getAttribute("type").match("image")) {
				if(images[n].getAttribute("src").match("_def.")) {
					images[n].onmouseover = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_def.", "_ovr."));
					}
					images[n].onmouseout = function() {
						this.setAttribute("src", this.getAttribute("src").replace("_ovr.", "_def."));
					}
				}						
			}
		}
	}
}
function mapOver(){
	var spans = document.getElementsByTagName("span");
	for(var i=0; i < spans.length; i++) {
		var ids=String(spans[i].getAttribute("id"));
		if(ids.match("map") && ids != "maptxt8"){
			if(ids.match("txt")){
				var num=ids.slice(-1);
				var buddyid = "maparea"+num;
			}else if(ids.match("area")){
				var num=ids.slice(-1);
				var buddyid = "maptxt"+num;
			}
			var myimg=spans[i].firstChild.firstChild;
			myimg.buddy=document.getElementById(buddyid).firstChild.firstChild;			
			myimg.onmouseover=function(){
				this.setAttribute("src", this.getAttribute("src").replace("_def.", "_ovr."));
				this.buddy.setAttribute("src", this.buddy.getAttribute("src").replace("_def.", "_ovr."));
			}
			myimg.onmouseout=function(){
				this.setAttribute("src", this.getAttribute("src").replace("_ovr.", "_def."));
				this.buddy.setAttribute("src", this.buddy.getAttribute("src").replace("_ovr.", "_def."));
			}		
		}
	}
}
if(window.addEventListener) {
	window.addEventListener("load", function(){ smartRollover(); mapOver(); }, false);
}
else if(window.attachEvent) {
	window.attachEvent("onload", function(){ smartRollover(); mapOver(); });
}

function randomImage(images) {
	var rdmNum=Math.floor(Math.random()*(images.length/3));
	document.write("<a href='"+images[rdmNum*3]+"'><img src='"+images[rdmNum*3+1]+"' alt='"+images[rdmNum*3+2]+"'></a>");
}
function randomLogoSet(logos) {
	var rdmNum=Math.floor(Math.random()*(logos.length));
	document.write("<li>"+logos[rdmNum][0]+"</li><li>"+logos[rdmNum][1]+"</li><li>"+logos[rdmNum][2]+"</li><li>"+logos[rdmNum][3]+"</li><li>"+logos[rdmNum][4]+"</li>");
}
function randomFeatureSet(features) {
	var rdmNum=Math.floor(Math.random()*(features.length));
	document.write("<dl class='box-style'><dd class='img'>"+features[rdmNum][0]+"</dd><dt>"+features[rdmNum][1]+"</dt><dd class='txt'>"+features[rdmNum][2]+"</dd></dl>"+
	"<dl class='box-style'><dd class='img'>"+features[rdmNum][3]+"</dd><dt>"+features[rdmNum][4]+"</dt><dd class='txt'>"+features[rdmNum][5]+"</dd></dl>"+
	"<dl class='box-style'><dd class='img'>"+features[rdmNum][6]+"</dd><dt>"+features[rdmNum][7]+"</dt><dd class='txt'>"+features[rdmNum][8]+"</dd></dl>");
}

