var galpage = 1

function init(){
	galpage = 1	
}

function roll(img_name, img_src) {
   	document[img_name].src = img_src;
}

function roll2(img_name1, img_src1, img_name2, img_src2) {
   	document[img_name1].src = img_src1;
	document[img_name2].src = img_src2;
}

function over1(but_num,over_out) {
	if(over_out=="over"){
	   	document['b'+but_num].src = "images/circle"+but_num+"-yellow.jpg"
	}else if(over_out=="out"){
		document['b'+but_num].src = "images/circle"+but_num+"-blue.jpg"
	}
}

function gallery_page_right(){
	if(galpage!=9){
		galpage++;
	}else{
		galpage=1;
	}
	
	document.getElementById("gal1").innerHTML = "<img src=\"images/thumbnail-" + (galpage * 3 - 2) + ".png\" onmousedown=\"gallery_click(" + (galpage * 3 - 2) + ")\">"
	document.getElementById("gal2").innerHTML = "<img src=\"images/thumbnail-" + (galpage * 3 - 1) + ".png\" onmousedown=\"gallery_click(" + (galpage * 3 - 1) + ")\">"
	document.getElementById("gal3").innerHTML = "<img src=\"images/thumbnail-" + (galpage * 3) + ".png\" onmousedown=\"gallery_click(" + (galpage * 3) + ")\">"
	nav(galpage)
	
	
	
	
}

function gallery_page_left(){
	if(galpage!=1){
		galpage--;
	}else{
		galpage=9;
	}
	
	document.getElementById("gal1").innerHTML = "<img src=\"images/thumbnail-" + (galpage * 3 - 2) + ".png\" onmousedown=\"gallery_click('" + (galpage * 3 - 2) + "')\">"
	document.getElementById("gal2").innerHTML = "<img src=\"images/thumbnail-" + (galpage * 3 - 1) + ".png\" onmousedown=\"gallery_click('" + (galpage * 3 - 1) + "')\">"
	document.getElementById("gal3").innerHTML = "<img src=\"images/thumbnail-" + (galpage * 3) + ".png\" onmousedown=\"gallery_click('" + (galpage * 3) + "')\">"
	nav(galpage)
	
	
}

function gallery_click(index){
	document.getElementById("gal_main").innerHTML = "<img src=\"images/photos-mainspotlight"+ index +".jpg\">"
}

function nav(cur){
	var i = 0
	var nav = ""
	
	do{
		i++;
		if(i == cur){
			nav = nav + "<img src=\"images/black-sq.png\">"	
		}else{
			nav = nav + "<img src=\"images/grey-sq.png\">"
		}
	}while(i!=9)
	document.getElementById("prog").innerHTML = nav
}

function construction_change(pg){
	var i = 0
	var out = ""
	do{
		i++
		if(i!=pg){
			out=out + "<img name=\"b"+i+"\" onmouseover=\"over1("+i+",'over')\" onmouseout=\"over1("+i+",'out')\" onmousedown=\"construction_change("+i+")\" src=\"images/circle"+i+"-blue.jpg\">"
		}else{
			out=out + "<img onmousedown=\"construction_change("+i+")\" src=\"images/circle"+i+"-yellow.jpg\">"
		}
		
		if(i==6) out = out + "<br>"
		
	}while(i!=12)
	
	document.getElementById("construction_index").innerHTML = out
	
	
	document.getElementById("construction").innerHTML = "<img src=\"images/construction-"+pg+".jpg\" />"
	document.getElementById("step").innerHTML = pg
	
	if(pg==1){
		document.getElementById("step_text").innerHTML = "Our careful excavators cut the pool walls, and floor to very tight specifications to ensure no excess material is wasted."
	}else if(pg==2){
		document.getElementById("step_text").innerHTML = "In-Floor cleaning systems bless many of our pools, and the feedback we get from the owners is \"I'd never own another pool without one!\""
	}else if(pg==3){
		document.getElementById("step_text").innerHTML = "First notice all plumbing lines are run in the ground, OUTSIDE the pool.  Secondly we use all \"Rigid\" Schedule 40 PVC, and heat bend the pipe to minimize fittings = fewer places for potential leaks."
	}else if(pg==4){
		document.getElementById("step_text").innerHTML = "We use dry gunite due to its far superior quality, and strength over tradition wet mix concrete.  Most of the pool builders in Oklahoma still use wet mix."
	}else if(pg==5){
		document.getElementById("step_text").innerHTML = "Notice that all the steps are rediused. This makes for easier cleaning through better water and automatic cleaner movement."
	}else if(pg==6){
		document.getElementById("step_text").innerHTML = "We utilize trough drain technology, the safest, most efficient drains on the market."
	}else if(pg==7){
		document.getElementById("step_text").innerHTML = ""
	}else if(pg==8){
		document.getElementById("step_text").innerHTML = "Each piece of stone is measured and cut to fit.  This minimizes grout joints and gives it a very clean look."
	}else if(pg==9){
		document.getElementById("step_text").innerHTML = "Our masons are some of the best in the business, Serenity Pools employs nothing less."
	}else if(pg==10){
		document.getElementById("step_text").innerHTML = "Pool equipmenthas been set, and painted.  Painting is a minor detail with big benefits.  It helps protect the pipe from harmfull UV rays, and gives it a much better look.  No more bright white pipes!"
	}else if(pg==11){
		document.getElementById("step_text").innerHTML = "Wood decks, and pergola going in."
	}else if(pg==12){
		document.getElementById("step_text").innerHTML = "Completed! Now all we need is a little landscaping!"
	}
}

