/*
No Right Click
*/
/*
var msg = ":-P  No right click for you!";
if(document.layers) window.captureEvents(Event.MOUSEDOWN);

function no_click(e){
if (navigator.appName == 'Netscape' && ( e.which == 2 || e.which == 3))
 {
  alert(msg);return false;
 }
 if (navigator.appName == 'Microsoft Internet Explorer' && (event.button == 2 || event.button == 3))
 {
   alert(msg);return false;
 }
}
window.onmousedown=no_click;
document.onmousedown=no_click;

*/
function openwindows(url, win, co) {
  selfwin = window.open(url,win,co,'scrollbar=yes');
	selfwin.focus();
}

/*
No Right Click Of Image
*/
var clickmessage="?Copyright by Trevvy";

function disableclick(e) { 
  if (document.all) { 
    if (event.button==2||event.button==3) { 
      if (event.srcElement.tagName=="IMG"){ 
        alert(clickmessage); 
        return false; 
	  }
	}
  } 
  else if (document.layers) { 
    if (e.which == 3) { 
      alert(clickmessage); 
      return false; 
    } 
  } 
  else if (document.getElementById){ 
    if (e.which==3&&e.target.tagName=="IMG"){ 
      alert(clickmessage) 
      return false 
    } 
  } 
} 

function associateimages(){ 
  for(i=0;i<document.images.length;i++) 
    document.images[i].onmousedown=disableclick; 
} 

if (document.all) document.onmousedown=disableclick 
else if (document.getElementById) document.onmouseup=disableclick 
else if (document.layers) associateimages()

function init() {
  if (!document.getElementById) return
  var imgOriginSrc;
  var imgTemp = new Array();
  var imgarr = document.getElementsByTagName('img');
  for (var i = 0; i < imgarr.length; i++) {
    if (imgarr[i].getAttribute('hsrc')) {
        imgTemp[i] = new Image();
        imgTemp[i].src = imgarr[i].getAttribute('hsrc');
        imgarr[i].onmouseover = function() {
            imgOriginSrc = this.getAttribute('src');
            this.setAttribute('src',this.getAttribute('hsrc'))
        }
        imgarr[i].onmouseout = function() {
            this.setAttribute('src',imgOriginSrc)
        }
    }
  }
}

onload=init;