
// -----------------------------------------------------------------------------------
// Generic code
// -----------------------------------------------------------------------------------

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}


function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

   

// Form Highlight   
function initHighlight() {
   	if (!document.getElementsByTagName){ return; }
    var allfields = document.getElementsByTagName("input");

    // loop through all input tags and add events
    for (var i=0; i<allfields.length; i++){
        var field = allfields[i];
        if ((field.getAttribute("type") == "text") || (field.getAttribute("type") == "password") ) {
            field.onfocus = function () {this. className = 'formActive';}
            field.onblur = function () {this.className = 'formInactive';}
        }
    }
}




// Fix specific png's for IE-6


function fixPng() {
	if(navigator.appName == "Microsoft Internet Explorer") {
		
		// Find out what version of IE - from http://msdn2.microsoft.com/en-us/library/ms537509.aspx
		var ua = navigator.userAgent;
		var re  = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
		if (re.exec(ua) != null)
		rv = parseFloat( RegExp.$1 );	
		
		if (rv <= 6.0) {
			if(document.getElementById('S360')){
				var img = document.getElementById("S360");
				var src = img.src;
				img.style.visibility = "hidden";
				
				var div = document.createElement("DIV"); 
				div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='')"; 
				div.style.width = 208;
				div.style.height = 37;
				
				img.replaceNode(div);
			}
			
			if(document.getElementById('sTag')){
				var img = document.getElementById("sTag");
				var src = img.src;
				img.style.visibility = "hidden";
				
				var div = document.createElement("DIV"); 
				div.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+src+"', sizingMethod='')"; 
				div.style.width = 207;
				div.style.height = 15;
				
				img.replaceNode(div);
			}
			
			
		}		
	}
}


// Nifty function to add onload events without overwriting
// ones already there courtesy of the lovely and talented
// Simon Willison http://simon.incutio.com/
function addLoadEvent(func) {   
	var oldonload = window.onload;
    if (typeof window.onload != 'function'){
        window.onload = func;
    } else {
        window.onload = function(){
        oldonload();
        func();
        }
    }
}

addLoadEvent(initHighlight);
addLoadEvent(fixPng);


