// JavaScript Document

//addimagediv.js by Thomas Forrester

function centerImageDiv(){
	center_h = Math.floor(document.body.clientHeight/2 - document.getElementById("addImageDiv").offsetHeight/2);
	document.getElementById("addImageDiv").style.position="absolute";
	document.getElementById("addImageDiv").style.top=center_h+"px";
	center_w = Math.floor(document.body.clientWidth/2 - document.getElementById("addImageDiv").offsetWidth/2);
	document.getElementById("addImageDiv").style.right=center_w +"px";
	//alert("Centering at " + center_w + "w by " + center_h + "h");
	window.scrollTo(center_w,center_h);
}

function changeImageDiv(theSRC){
	document.getElementById("addImageDivImage").src = theSRC;
}

function hideImageDiv(){
	document.getElementById("addImageDiv").style.visibility="hidden";
	document.getElementById("frame_list").style.visibility="hidden";
}

function hideImageDivShowFrameList(){
	document.getElementById("addImageDiv").style.visibility="hidden";
	document.getElementById("frame_list").style.visibility="visible";
}

function showImageDiv(){
	centerImageDiv();
	document.getElementById("addImageDivFrame").style.backgroundImage = "url(http://www.lenscapesllc.com/framing_interface/images/addimagebutton.gif)";
	document.getElementById("addImageDivContinue").style.backgroundImage = "url(http://www.lenscapesllc.com/framing_interface/images/addimagebutton.gif)";
	document.getElementById("addImageDiv").style.visibility="visible";
}

function addImageDivShow(theSRC){
	//theSRC = prompt('Enter Image');
	document.getElementById("frame_list").style.visibility="hidden";
	changeImageDiv(theSRC);
	showImageDiv();
}

function addImageDivSetClick(){
	//addImageDivX=event.clientX;
	//addImageDivY=event.clientY;
}

function goToFrameIt(){
	location.href="http://www.lenscapesllc.com/framing_interface/index.php";
}