function dsp(loc){
   if(document.getElementById){
      var foc=loc.firstChild;
      foc=loc.firstChild.innerHTML?
         loc.firstChild:
         loc.firstChild.nextSibling;
      foc=loc.parentNode.nextSibling.style?
         loc.parentNode.nextSibling:
         loc.parentNode.nextSibling.nextSibling;
      foc.style.display=foc.style.display=='block'?'none':'block';}}

function switch_img(imgname,status,dir){
	document.images[imgname].src=dir+"images/"+imgname+status+".jpg";
}

function switch_bigimg(imgname,dir){
	document.images['bigimg'].src=dir+"images/user_img/"+imgname+".jpg";
}

//My favourites
function ChecklistDel(el_val){
window.open('check_del.php?el='+el_val,'checklist','WIDTH=300,HEIGHT=300,scrollbars=yes,resize=yes,left=150,top=100,screenX=150,screenY=100');
}

function ChecklistAdd(el_val,s_url){
window.open('check_add.php?el='+el_val,'checklist','WIDTH=300,HEIGHT=300,scrollbars=yes,resize=yes,left=150,top=100,screenX=150,screenY=100');
}

function Checklist(element) {
 if (document.images) {
	if (element.type == "checkbox") {
	if (element.checked)
	ChecklistAdd(element.value);
	else
	ChecklistDel(element.value);

  }
 }
}
//-------------------

/*
	Standards Compliant Rollover Script
	Author : Jonathan Whiting
	http://www.crayonsandwalls.com
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;
