// JavaScript Document

function roller ($element,$action) {
var $path = "images/";

var splitter=document.title;
var pageName=splitter.split(" ");
var thePage=pageName[4].toLowerCase();


if (thePage!=$element){
	if ($action=="over") {	
		document.getElementById($element).src=$path+$element+'O.gif';				
	}
	
	if ($action=="out") {		
		document.getElementById($element).src=$path+$element+'.gif';		
	}
}

}



function highlighter(cat) {
	
	
var splitter=document.title;
var pageName=splitter.split(" ");
var changeIt=pageName[4].toLowerCase();
var $path = "images/";

if (changeIt=="about" || changeIt=="preferred" || changeIt=="new" || changeIt=="showroom" || changeIt=="services" || changeIt=="contact"){
var theTag=document.getElementById(changeIt);
theTag.style.color='#435608';
} 
else if (changeIt=="used" || changeIt=="web" || changeIt=="newest"){
	
document.getElementById(changeIt).src=$path+changeIt+'O.gif';
}


}




function makeGreen($category,$task){

	var theCat=document.getElementById($category);
	if($category){
	theCat.style.color='#6A9913';
	}
var sect=new Array();
sect['seating']="stng";
sect['systems']="systm";
sect['desks']="dsks";
sect['storage']="strg";
sect['tables']="tbl";
if ($category=="seating" || $category=="systems" || $category=="desks" || $category=="storage" || $category=="tables"){
document.getElementById(sect[$category]).style.display="block";
}

if ($category=="tables"){
if ($task=="conference") {	$task="conf";}	
if ($task=="lounge") {	$task="lnge";}	
}

	if ($task){
		if ($task=="splash"){
			$i=0;
		}else if ($task=="all"){
			$i=0;
		}else{
	var theType=document.getElementById($task);
	theType.style.color='#6A9913';
	}
	}
}


function changer(pic,uid){

		oldSource=document.getElementById('mainimg').src;
		//remover=oldSource.substr(-5);
	
	pathTo="images/catalog/";
	newImg=pathTo+uid+pic+".jpg";
	/*switch(pic){
	case "A":
	
	newSource=oldSource.replace(remover,'A.jpg');
	break;
	
	case "B":
	newSource=oldSource.replace(remover,'B.jpg');
	break;
	
	case "C":
	newSource=oldSource.replace(remover,'C.jpg');
	break;
	}*/
		
	document.getElementById('mainimg').src=newImg;
	
}



function showCase(upORdown,curPic,totPic) {
filePath="images/showroom/";

if (upORdown=="next"){
	targe=curPic+1;
	whichpic=filePath+targe+".jpg";
}else{
	targe=curPic-1;
	whichpic=filePath+targe+".jpg"
}

document.getElementById('showImg').src = whichpic;	


//prevPic=curPic-1;
//nextPic=curPic+1;

nextLink=" <a href=\"javascript: showCase('next',"+targe+","+totPic+");\">>></a>";
prevLink="<a href=\"javascript: showCase('prev',"+targe+","+totPic+");\"><<</a> ";

if (targe==1){
	$message=targe+" of "+totPic+nextLink;
} else if (targe==totPic){
	$message=prevLink+" "+targe+" of "+totPic;
} else{
	$message=prevLink+" "+targe+" of "+totPic+" "+nextLink;
}

if (targe==1){
theCaption="Entrance";
}

if (targe==2){
theCaption="Reception";
}


if (targe==3){
theCaption="Waiting Area";
}

if (targe==4){
theCaption="Conference Room";
}

if (targe==5){
theCaption="Training Room";
}

if (targe==6){
theCaption="Offices";
}


if (targe==7){
theCaption="Design Library";
}

if (targe==8){
theCaption="2nd Floor Showroom";
}

if (targe==9){
theCaption="3rd Floor Showroom";
}

if (targe==10){
theCaption="3rd Floor Showroom";
}



	document.getElementById('showCaption').innerHTML=theCaption;
document.getElementById('imageControl').innerHTML=$message;
}


