function showlarge(imagenumber){//image number corresponds to the image, ie 1 will display 1.jpg, etc
	var disabler=document.getElementById('disabler');//grab the disabler containter
	if(!disabler){//if it doesn't exist then create it
		disabler=document.createElement('div');
		disabler.id='disabler';
		document.body.appendChild(disabler);
	}
	
	var pageheight='50%';
	if(document.documentElement.scrollHeight){
		pageheight=document.documentElement.scrollHeight;
	}else if(document.body.scrollHeight){
		pageheight=document.body.scrollHeight;
	}
	
	disabler.style.height=pageheight+'px';
	disabler.style.visibility='visible';
	
	var divvy=document.getElementById('largeimage');//grab the large container
	if(!divvy){//if the container doesn't exist then create it
		divvy=document.createElement('div');
		divvy.id='largeimage';
		document.body.appendChild(divvy);
		divvy.innerHTML='<a href="javascript:;"onclick="closeimage()"id="aclose"><img src="../img/close.gif"></a><img id="imglargeimage"src="../img/largeimage.gif">';
	}
	
	var img=document.getElementById('imglargeimage');
	if(img)img.src='../imageGallery/'+imagenumber+'.jpg';
	
	if(divvy.offsetLeft<0)divvy.style.left='215px';else	divvy.style.left='50%';
	
	var windowtop=0;
	var scrolltop=0;
	if(document.documentElement.scrollTop){
		scrolltop=document.documentElement.scrollTop;
	}else if(document.body.scrollTop){
		scrolltop=document.body.scrollTop;
	}
	windowtop=scrolltop;
	
	if(document.documentElement.clientHeight){
		windowtop+=document.documentElement.clientHeight/2;
	}else if(document.body.clientHeight){
		windowtop+=document.body.clientHeight/2;
	}
	windowtop-=divvy.offsetHeight/2;
	
	if(windowtop<scrolltop)windowtop=scrolltop;
	if(windowtop<0)windowtop=0;
	divvy.style.top=windowtop+'px';
	
	divvy.style.visibility='visible';
}

function closeimage(){
	var disabler=document.getElementById('disabler');//grab the semi-transparent blue background
	if(disabler)disabler.style.visibility='hidden';
	var divvy=document.getElementById('largeimage');//grab the large container
	if(divvy)divvy.style.visibility='hidden';
	var img=document.getElementById('imglargeimage');
	if(img)img.src='../img/largeimage.gif';
}

var hidetimer,hideid;
function show(id){
	clearInterval(hidetimer);
	document.getElementById(id).style.visibility='visible';
}

function initiatehide(id){
	clearInterval(hidetimer);
	hideid=id;
	hidetimer=setInterval(hide,100);
}

function hide(){
	clearInterval(hidetimer);
	document.getElementById(hideid).style.visibility='hidden';
}

function rollon(o){//assumes the normal state image has a filename 'filename_n.ext'
	o=o.getElementsByTagName('img')[0];
	o.src=o.src.replace('_n','_o');
}

function rolloff(o){//assumes the over state image has a filename 'filename_o.ext'
	o=o.getElementsByTagName('img')[0];
	o.src=o.src.replace('_o','_n');
}

if(document.all){document.write('<link href="../css/coreie.css" rel="stylesheet" type="text/css">');}
