var frameb = 1;
var matb = 1;
var wallb = 1;
var baseprice = 1;
var frameprice = 1;
var matprice = 1;
var thisimg = 1;

function getBase(base){
	baseprice = base;
}

/*function updateMatte(newcolor,wid,hig,n,mprice){
	
	var showsmall = document.getElementById("frame-image");
	showsmall.style.display = "block";
	
	var hidebig = document.getElementById("big-image");
	hidebig.style.display = "none";
	
	
	var getid = document.getElementById("frame-matte");
	
	if(newcolor){
		if(matb != 1){
			matb.setAttribute("class","frameimgoff");
			matb.className = "frameimgoff";	
		}
		//alert(fi);
		matb = document.getElementById("matte-" + newcolor);
		matb.setAttribute("class","frameimgon");
		matb.className= "frameimgon";
	}
	
	getid.setAttribute("style","background-color:#" + newcolor + ";width:" + wid + "px;height:" + hig + "px;");
	getid.style.height = hig + "px";
	getid.style.width = wid + "px";
	getid.style.backgroundColor = "#" + newcolor;
	
	//alert(wid);  
	var setinput = document.getElementById('input-matte-color');
	setinput.value = n + " (+" + mprice + ")";
	
	var setPrice = document.getElementById('pit-price');
	var setPriceS = setPrice.getElementsByTagName('span')[0];
	
	if(frameprice != 1){
		setPriceS.innerHTML = "$" + (baseprice + mprice + frameprice);
	} else {
		setPriceS.innerHTML = "$" + (baseprice + mprice);
	}
	if(mprice){
		var matprice = mprice;
	} else {
		matprice = 1;
	}
}*/

function updateWall(col){
	
	if(col){
		if(wallb != 1){
			wallb.setAttribute("class","frameimgoff");
			wallb.className = "frameimgoff";	
		}
		//alert(fi);
		wallb = document.getElementById("wall-" + col);
		wallb.setAttribute("class","frameimgon");
		wallb.className= "frameimgon";
	}
	
	var gettable = document.getElementById("frametable");
	var getNode = gettable.getElementsByTagName("td")[0];
	getNode.style.backgroundColor = "#" + col;

}

function updateFrame(iid,iname,fprice,dnum,dimi){

// image name,name of frame,id,price,frame dimensions,matte dimensions
	
	var setPrice = document.getElementById('pit-price');
	var setPriceS = setPrice.getElementsByTagName('span')[0];
	
	// update frame price
	if(fprice){
		setPriceS.innerHTML = "$" + fprice;		
	} else {
		frameprice = 1;
	}
	
	var setinput = document.getElementById('vwitem');
	setinput.value = iid;
	
	// change frame border
	if(frameb != 1){
		frameb.setAttribute("class","frameimgoff");
		frameb.className = "frameimgoff";	
	}

	frameb = document.getElementById("inset-" + dnum);
	frameb.setAttribute("class","frameimgon");
	frameb.className= "frameimgon";
	
	//show/hide div
	if(thisimg != 1){
		thisimg.style.display = "none";
	}

	thisimg = document.getElementById("showframe" + dnum);
	thisimg.style.display = "block";
	
	if(dimi){
		var getpit = document.getElementById("pit-frame")
		getpit.innerHTML = dimi + "<br/>Framed Size"; 
	}
	
	
	
}

function hideDiv(n){
	for(i=0;i<n;i++){
		hdiv = document.getElementById("showframe"+i);
		hdiv.style.display = "none";
	}
}

