

// JavaScript Document


// Changes the class of the given tag from classa to classb or back
 function classoggle(tag, classa, classb) {
   if (tag.className==classa){
      tag.className=classb;
    } else {
      tag.className=classa;
     }
 }
// Toggles the class name of the indexed div between 'hideMe' and 'showMe'
   function visoggle(divID) {
      var d = document.getElementById(divID);
      classoggle(d, 'hide', 'show');
   }
   
   function hidedivs(divID2){
	   document.getElementById(divID2).className='hide';
   }
   
   
   // Image Rollovers
   
   
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 == 'roll') {
                    var src = aImages[i].getAttribute('src');
                    var ftype = src.substring(src.lastIndexOf('.'), src.length);
                    var hsrc = src.replace(ftype, '_r'+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('_r'+ftype, ftype);
                                this.setAttribute('src', sTempSrc);
                    }
                }
    }
}

window.onload = initRollovers;


/*
Disable right click script II (on images)- By Dynamicdrive.com
For full source, Terms of service, and 100s DTHML scripts
Visit http://www.dynamicdrive.com
*/

var clickmessage="You may not use images from Sturt Fleurieu General Practice Education and Training (GPET) without written consent."

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()
