img1on = new Image();           // Active images
img1on.src = "http://www.kellyshpeley.com/images/nav/sketches_on.jpg";  
img2on = new Image(); 
img2on.src = "http://www.kellyshpeley.com/images/nav/paint_on.jpg";  
img3on = new Image();
img3on.src = "http://www.kellyshpeley.com/images/nav/comm_on.jpg";
img4on = new Image();
img4on.src = "http://www.kellyshpeley.com/images/nav/bio_on.jpg";
img5on = new Image();
img5on.src = "http://www.kellyshpeley.com/images/nav/news_on.jpg";
img6on = new Image();
img6on.src = "http://www.kellyshpeley.com/images/nav/contact_on.jpg";

img1off = new Image();          // Inactive images
img1off.src = "http://www.kellyshpeley.com/images/nav/sketches_off.jpg"; 
img2off = new Image();
img2off.src = "http://www.kellyshpeley.com/images/nav/paint_off.jpg";  
img3off = new Image();
img3off.src = "http://www.kellyshpeley.com/images/nav/comm_off.jpg";
img4off = new Image();
img4off.src = "http://www.kellyshpeley.com/images/nav/bio_off.jpg";
img5off = new Image();
img5off.src = "http://www.kellyshpeley.com/images/nav/news_off.jpg";
img6off = new Image();
img6off.src = "http://www.kellyshpeley.com/images/nav/contact_off.jpg";

function imgOn(imgName) {
   if (document.images) {
       document[imgName].src = eval(imgName + "on.src");
        }
}

function imgOff(imgName) {
        if (document.images) {
            document[imgName].src = eval(imgName + "off.src");
        }
		  }
		  
function imagepopup(name,imagename,imagewidth,imageheight, imgcaption) {
	var winwidth= imagewidth+60;
	var winheight = imageheight +90; 

    
                 myhandle=window.open("","myWindow","width="+winwidth+",height="+winheight, scrollbars=0);
    myhandle.document.writeln('<html>');

	myhandle.document.writeln('<head>');

  	myhandle.document.writeln('<title>'+name+'</title>');

	myhandle.document.writeln('<link rel="stylesheet" type="text/css" href="style/popup.css" title="stylesheet" media="screen" />');
myhandle.document.writeln('</head>');
  	myhandle.document.writeln('<body>');

myhandle.document.writeln('<div class="page">');

    myhandle.document.writeln('<a  href="javascript:close()"><img class="imglink" src="'+imagename+'" width="'+imagewidth+'" height="'+imageheight+'" alt="big image" /></a>');
 
myhandle.document.writeln('<div class="imgcaption">'+imgcaption+'</div>');

myhandle.document.writeln('</div>');


myhandle.document.writeln('<br /><a  href="javascript:close()">close</a>');

    myhandle.document.writeln('</body>');
  	
  	myhandle.document.writeln('</html>');
}


var dtsl={
	buttonClass:'submitbutton',
	init:function(){
		var i,newa,inputs;
		if(!document.getElementById || !document.createTextNode){return;}
		inputs=document.getElementsByTagName('input');
		for(i=0;i<inputs.length;i++){
			if(inputs[i].getAttribute('type')!='submit'){continue;}
			newa=document.createElement('a');
			newa.setAttribute('href','#');
			newa.setAttribute('id',inputs[i].getAttribute('id'));
			newa.appendChild(document.createTextNode(inputs[i].getAttribute('value')));
			newa.className=dtsl.buttonClass;
			newa.f=inputs[i].form;
			dtsl.addEvent(newa,'click',dtsl.sendForm,false);
			newa.onclick=function(){return false;} // Safari
			inputs[i].parentNode.insertBefore(newa,inputs[i]);
			inputs[i].parentNode.removeChild(inputs[i]);
			if(i<inputs.length){i--};
		}
	},
	// you may have to alter sendForm when there is more than one form 
	// in the document
	sendForm:function(e){
		dtsl.cancelClick(e);
		var t=dtsl.getTarget(e);
		var f=t.f;
		//var newel=document.createElement('input');
		//newel.name=t.id;
		//newel.value=t.innerHTML;
		//f.appendChild(newel);


		f.submit();
	},
	getTarget:function(e){
		var target = window.event ? window.event.srcElement : e ? e.target : null;
		if (!target){return false;}
		while(target.nodeType!=1 && target.nodeName.toLowerCase()!='body'){
			target=target.parentNode;
		}
		return target;
	},
	cancelClick:function(e){
		if (window.event){
			window.event.cancelBubble = true;
			window.event.returnValue = false;
			return;
		}
		if (e){
			e.stopPropagation();
			e.preventDefault();
		}
	},
	addEvent: function(elm, evType, fn, useCapture){
		if (elm.addEventListener) 
		{
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
		}
	}
}
//dtsl.addEvent(window, 'load', dtsl.init, false);

















