/* ***************************************
Javascript developed by input 9 interactive
Link: http://www.input9.com

(c) 2010

Author: Bill Hanff

Last Modified: January 10, 2010
*************************************** */


// Global variables
var isFirefox;
var isIE;


function sniff() {
		
			var ff = "Netscape";
			var ie = "Microsoft Internet Explorer";
			
			isFirefox = ( navigator.appName == ff );
			isIE = (navigator.appName == ie ); 
		}

function fadeIn(objID, opacity) {
	if (document.getElementById) {
		obj = document.getElementById(objID);
		if (opacity < 100) {
			opacity += 10;
			setOpacity(obj, opacity);
			window.setTimeout("fadeIn('"+objID+"',"+opacity+")", 50);
			}
		}
	}

function setOpacity(obj, opacity) {
	opacity = (opacity == 100)?99.99:opacity; 
	obj.style.filter = "alpha(opacity:"+opacity+")"; // IE/Win
	obj.style.KHTMLOpacity = opacity/100; // Safari<1.2, Konqueror
	obj.style.MozOpacity = opacity/100; // Older Mozilla and Firefox
	obj.style.opacity = opacity/100;	// Safari 1.2, newer Firefox and Mozilla, CSS3
	}
	
	
function showhide(divID){
		var node = document.getElementById(divID);
		if(node.className == "hide"){
			node.className = "show";
			fadeIn(divID, 0);
		} else {
			node.className = "hide";
		}
	}
	
	
function externalLinks() {
			var links = document.getElementsByTagName('a');// Fetch all the anchor elements in the document.
			for (var i = links.length; i != 0; i--) { // Loop through the a elements
				var a = links[i-1]; // Pull out the element for this iteration.
				if (!a.href) continue; // If the element doesn't have an href, skip it.
				if (a.className && a.className.indexOf('external') != -1){
						a.target = '_blank';
				}
			}
		}
	
function init(){
	sniff();
	externalLinks();
	}
	
function str_replace(orgChar, newChar, str){
	var a = str;
	a=a.split(orgChar).join(newChar);
	return a;
	}
