﻿var HasW3CDOM = (document.createElement != null && document.getElementsByTagName != null);

window.onload = CommonLoad;

function CommonLoad() {
	if (!HasW3CDOM) return;
	
	HandleNewWindowLinks();
	HandleIE6Flicker();
};

function HandleNewWindowLinks() {
	var strTemp = new String;
	var arrLinks = window.document.getElementsByTagName("a");
	
	for (var numIndex = 0; numIndex < arrLinks.length; numIndex++) {
		if (arrLinks[numIndex].className != null) {
			if (arrLinks[numIndex].className.match(/js_NewWindow/)) {
				//Save [href] before replaceing [onclick] or [href] will return [null]
				strTemp = arrLinks[numIndex].href;
				
				arrLinks[numIndex].onclick = function() {
					window.open(strTemp, "");
					
					return false;
				};
			};
		};
	};
};

function HandleIE6Flicker() {
	try {
	  document.execCommand("BackgroundImageCache", false, true);
	} catch(err) {}
}

function rotate() {
  if (document.images) {
    if (imgThis < imgCount) {
    
        /*
        if (document.all) {
            document.getElementById('AlternatingLogo').style.filter="blendTrans(duration=1)";
            document.getElementById('AlternatingLogo').filters.blendTrans.Apply();
        }
        */
        
        document.getElementById('AlternatingLogo').src = arrImages[imgThis];
        
        /*
        if (document.all) {
            document.getElementById('AlternatingLogo').filters.blendTrans.Play();
        }
        */
        
        setTimeout("rotate()", 3000)
        
        if (imgThis == (imgCount-1)) {
            imgThis = 0;
        }
        
        else {
            imgThis++;
        }
    }
  }
}
