/**
 * @author tom
 */
function swapClass(){
	
	var i,x,tB,j=0,tA=new Array(),arg=swapClass.arguments;
	if(document.getElementsByTagName){
	 	for(i=4; i<arg.length; i++){
			tB = document.getElementsByTagName(arg[i]);
			
			
			
			for(x=0;x<tB.length;x++){
				tA[j]=tB[x];j++;
			}
		}
		for(i=0;i<tA.length;i++){
	  		if(tA[i].className){
				if(tA[i].id==arg[1]){
					if(arg[0]==1){
	  					tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
					}else{
						tA[i].className=arg[2];
					}
	  			}else if(arg[0]==1 && arg[1]=='none'){
					if(tA[i].className==arg[2] || tA[i].className==arg[3]){
	 					 tA[i].className=(tA[i].className==arg[3])?arg[2]:arg[3];
					}
		  		}else if(tA[i].className==arg[2]){
					tA[i].className=arg[3];
				}
			}
		}
	}
}


function switchIt(id1, newClass1, id2, newClass2){
	document.getElementById(id1).className = newClass1; 
	document.getElementById(id2).className = newClass2; 
	
}
function SimpleSwap(el,which){
        el.src=el.getAttribute(which||"origsrc");
}
 

function SimpleSwapSetup(){
  var x = document.getElementsByTagName("img");
  for (var i=0;i<x.length;i++){
    var oversrc = x[i].getAttribute("oversrc");
    if (!oversrc) continue;
    // preload image
    // comment the next two lines to disable image pre-loading
    x[i].oversrc_img = new Image();
    x[i].oversrc_img.src=oversrc;
    // set event handlers
    x[i].onmouseover = new Function("SimpleSwap(this,'oversrc');");
    x[i].onmouseout = new Function("SimpleSwap(this);");
    // save original src
    x[i].setAttribute("origsrc",x[i].src);
  }
}


var PreSimpleSwapOnload =(window.onload)? window.onload : function(){};
window.onload = function(){PreSimpleSwapOnload(); SimpleSwapSetup();}


/*sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);*/

function fixIE6flicker(fix) {
	try {
		document.execCommand("BackgroundImageCache", false, fix);
	} catch(err) { }
}
fixIE6flicker(true);