// JavaScript Document

function fixtureschange(imgname,name,model){
	document.theimage.src = imgname;
	var iDiv = document.getElementById("fixturename");
    iDiv.innerHTML = "Name: " + name;
	var iiDiv = document.getElementById("fixturemodel");
    iiDiv.innerHTML = "Model: " + model;
}

function tilechange(imgname,name,type,sizes){
	document.theimage.src = imgname;
	var oDiv = document.getElementById("tilename");
    oDiv.innerHTML = "<b>Name:</b> " + name;
	var ooDiv = document.getElementById("tiletype");
    ooDiv.innerHTML = "<b>Type:</b> " + type;
	var ooooDiv = document.getElementById("tilesizes");
	ooooDiv.innerHTML = "<b>Sizes Available:</b> " + sizes;
	
}
function tilechange1(imgname,name,type){
	document.theimage.src = imgname;
	var oDiv = document.getElementById("tilename");
    oDiv.innerHTML = "<b>Name:</b> " + name;
	var ooDiv = document.getElementById("tiletype");
    ooDiv.innerHTML = "<b>Type:</b> " + type;

}
function tilechange1b(imgname,name,type,slab){
	document.theimage.src = imgname;
	var oDiv = document.getElementById("tilename");
    oDiv.innerHTML = "<b>Name:</b> " + name;
	var ooDiv = document.getElementById("tiletype");
    ooDiv.innerHTML = "<b>Type:</b> " + type;
	/* ***DO NOT UNCOMMENT*** This is being handled by onclick inside the slab link tag.  -CB 4/26
	var oooDiv = document.getElementById("slabimg");
    oooDiv.innerHTML = "<a class='slab-img' rel='lightbox' href='" +slab+ "'>View Slab Photo</a>";*/
	
}
function tilechange2(imgname,name,price){
	document.theimage.src = imgname;
	var oDiv = document.getElementById("tilename");
    oDiv.innerHTML = "<b>Name:</b> " + name;
	var ooDiv = document.getElementById("tileprice");
    ooDiv.innerHTML = "<b>Price:</b> " + price;

}
function tilechange4(imgname,name,type,sizes,price,orgprice){
	document.theimage4.src = imgname;
	var oDiv = document.getElementById("tilename4");
    oDiv.innerHTML = "<b>Name:</b> " + name;
	var ooDiv = document.getElementById("tiletype");
    ooDiv.innerHTML = "<b>Type:</b> " + type;
	var oooDiv = document.getElementById("tilesizes");
    oooDiv.innerHTML = "<b>Sizes Available:</b> " + sizes;
	var ooooDiv = document.getElementById("tileoriginalprice");
    ooooDiv.innerHTML = "<b>Original Price:</b> " + orgprice;
	var oooooDiv = document.getElementById("tileprice");
    oooooDiv.innerHTML = "<b>Sale Price:</b> " + "<span class='sale-price'>" + price + "</span>";
	
}
function slabchange(imgname,name,type,uses,sizes){
	document.theimage.src = imgname;
	var oDiv = document.getElementById("tilename");
    oDiv.innerHTML = "Name: " + name;
	var ooDiv = document.getElementById("tiletype");
    ooDiv.innerHTML = "Type: " + type;
	var oooDiv = document.getElementById("tileuses");
	oooDiv.innerHTML = "Uses: " + uses;
	var ooooDiv = document.getElementById("tilesizes");
	ooooDiv.innerHTML = "Available Sizes: " + sizes;
	
}

function vermontchange(imgname,description){
	document.theimage.src = imgname;
	var aDiv = document.getElementById("vermontdescription");
    aDiv.innerHTML = description;
}

function useInnerHTML() {
}

/*Added swapHighlight to hilight current selection and unhilight the previous selection. Added c & d arguments on 4/26. Chris Brueck: 888-362-7855*/
function swapHighlight(a,b,c,d)
{	
	a.className="imgclicked";
	/*Added this condition to check if thumbnail is already highlighted. If it is highlighted already, function exits returning false and thumbnail remains highlighted. -CB 4/26
	if (last = this.id){return false;}*/
	/*Check to see if this is the first thumbnail to be checked on the page. If so, varible LAST val is set to this id. Else LAST highlighted thumbnail is unhighlighted and new LAST val is this id*/
	if (typeof last=="undefined"){last=b}
	else{document.getElementById(last).className="imgclick";last=b}
	/*Check if the slab link exists before acting, so we don't generate any js errors on pages that don't have the slab link -CB 4/26*/
	slabElement = document.getElementById("slablink");
	if (slabElement != null){
		slabPath = "http://www.stonecity.com/wp-content/uploads/"+c;
		slabtitle=d;
	}
}

function swapHighlight2(a,b,c,d,e)
{	
	a.className="imgclicked";
	/*Added this condition to check if thumbnail is already highlighted. If it is highlighted already, function exits returning false and thumbnail remains highlighted. -CB 4/26
	if (last = this.id){return false;}*/
	/*Check to see if this is the first thumbnail to be checked on the page. If so, varible LAST val is set to this id. Else LAST highlighted thumbnail is unhighlighted and new LAST val is this id*/
	if (typeof last=="undefined"){last=b}
	else{document.getElementById(last).className="imgclick";last=b}
	/*Check if the slab link exists before acting, so we don't generate any js errors on pages that don't have the slab link -CB 4/26*/
	slabElement = document.getElementById("slablink");
	if (slabElement != null){
		slabPath = "http://www.stonecity.com/wp-content/uploads/"+c;
		slabtitle=d;
	}
	var oooooooooDiv = document.getElementById("photoavailability");
    oooooooooDiv.innerHTML = e;
}
