window.onload = function() {
	
	if(imagestr=='') {
		alert('imagestr is empty, could not load header');	
		return false;
	}
	var header = document.getElementById('cpheaderid');
	if(!header) {
		alert('the element cpheaderid could not be found, could not load header');
		return false;
	}
	var footer = document.getElementById('cpfooterid');
	if(footer) {
		footer.style.backgroundImage = 'url(/img/headers/'+imagestr+')';
	}
	header.style.backgroundImage = 'url(/img/headers/'+imagestr+')';
	var d = document.createElement('a');
	d.id = 'imgdiv1';
	//d.style.display = 'none';
	d.setAttribute('onmouseover','showimg();');
	header.appendChild(d);
    header.setAttribute('onmouseover','showimg();');
}

function showimg(){
	$('imgdiv1').appear();
	$('imgdiv1').onclick = function(){ TINY.box.show('/photos/view/'+imagestr+'/',1,600,300,1); setTimeout('kenburst()',2000); }
}

function kenburst() {
	if($('ken')){
		morphtofront();
	}
}

function morphtofront() {
	$('ken').morph('width:1000px;');	
	setTimeout("morphtoback();",2000);
}

function morphtoback() {
	$('ken').morph('width:300px;');		
	setTimeout("morphtofront();",7000);
}