//****************RAN COLOR****************************8
/*function navColor(){
	var Color = new Array/*("#FFFFFF")("#3399FF","#51B4FF","#99CCFF")
	var ranColor = Math.round(Math.random()*(Color.length - 1));
	if (ranColor){document.getElementById('navTable').style.background=Color[ranColor];}
	
}*/

/*
function getPageName(){
	var pageName = window.location.pathname;
	//var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
	var pageName = pageName.substring(pageName.lastIndexOf('/') + 1);
	alert(pageName);
	}
*/

function imageGlazingImages(){
	var imagesarray = new Array("images/imageGlazing/castle02.jpg","images/imageGlazing/pier.jpg","images/imageGlazing/castle.jpg");
	var randomnumber = Math.round(Math.random()*(imagesarray.length - 1));
	if (randomnumber){
		document.images.imageGlazing.src = imagesarray[randomnumber];
	}
}
	
	


function ColorBar(){
	var Color = new Array("#FF9900","#FF4400","#FF7205")
	//var ImgCurves = new Array ("images/curve-FF9900.gif","images/curve-FF4400.gif","images/curve-FF7205.gif")
	var ranColor = Math.round(Math.random()*(Color.length - 1));
	if (ranColor){
		document.getElementById('hedColor1').style.background=Color[ranColor];
		//document.getElementById('hedColor2').style.background=Color[ranColor];
		//document.getElementById('barCurve').src=ImgCurves[ranColor];
	}
	
}

//****************RANDOM IMAGES ON LOAD  ******************* 
function RandomizeNavImage(){
	var imagesarray = new Array("images/dyn_images/nav/navImage04.jpg","images/dyn_images/nav/navImage03.jpg","images/dyn_images/nav/navImage02.jpg","images/dyn_images/nav/navImage01.jpg")
	var randomnumber = Math.round(Math.random()*(imagesarray.length - 1));
	if (randomnumber){
		document.images.navImage1.src = imagesarray[randomnumber];
	}
}




function RandomizeContentImage(){
	var imagesarray = new Array("images/galleries/g5/hme/surf_W100H105.jpg","images/galleries/g2/hme/jug01_W100H105.jpg","images/galleries/g2/hme/jug02_W100H105.jpg","images/galleries/g2/hme/jug03_W100H105.jpg","images/galleries/g2/hme/jug04_W100H105.jpg","images/dyn_images/storm_W100H105.jpg","images/dyn_images/redPlt_W100H105.jpg","images/dyn_images/hand_W100H105.jpg","images/dyn_images/fish_W100H105.jpg","images/dyn_images/chicken_W100H105.jpg");
	var randomnumber = Math.round(Math.random()*(imagesarray.length - 1));
	if (randomnumber){
		document.images.contentImage.src = imagesarray[randomnumber];
	}
}
//********** STATUS BAR *******************

window.defaultStatus = " Glaze Away North Wales: Call us on 01492 533500 "
function statusBarOn(){
	window.defaultStatus = " Glaze Away: Call us on 01492 533500 "
}
function statusBarOff(){
	window.defaultStatus = " Glaze Away: "
}
//************* New Window ************************

var fileName = window.location.href;
fileName= fileName.substr(fileName.lastIndexOf("/") + 1);
defaultStatus = fileName;
//alert(fileName);

var newWindow="";
var URL="construction.htm";
function openGalWin(){
	windowFeatures = "width=320, height=320";
	windowFeatures = windowFeatures + "left=0,top=0"; 
	if (!newWindow.closed && newWindow.location){
		newWindow.location.href = URL;
		newWindow.close();
		newWindow=window.open(URL,"newwin",windowFeatures);
	}else{
		newWindow=window.open(URL,"newwin",windowFeatures);
		if (!newWindow.opener){newWindow.opener = self;}
	}
		if (window.focus){newWindow.focus()}
}

/************** Close newWindow so that it refreshes to the correct size next time *******/
function window_onunload(){
	if (typeof(newWindow) != "undefined" && newWindow.closed==false){
		newWindow.close();
	}
}
	
/************* Back *************/
function back_onclick()
{
	history.go(-1)
}
