sIFR.forceTextTransform = true;

var itcRatiosAry = [8, 1.41, 11, 1.31, 15, 1.29, 25, 1.25, 28, 1.23, 32, 1.22, 33, 1.23, 39, 1.22, 56, 1.21, 59, 1.2, 60, 1.21, 91, 1.2, 92, 1.19, 97, 1.2, 98, 1.19, 101, 1.2, 103, 1.19, 105, 1.2, 108, 1.19, 110, 1.2, 114, 1.19, 115, 1.2, 119, 1.19, 120, 1.2, 1.19];

// wrap the first letter and the rest inside of spans
initPage = function(){
  startList();
	// get all with class of titleLine
  var els = YAHOO.util.Dom.getElementsByClassName('titleLine');
	var l = els.length;
  //alert("num els " + l);
	for (i=0;i<l;i++){ createDropCaseSpans(els[i]); }
	
	sIFR.replace(tyfa, { css:'.sIFR-root { }', selectable:false, selector: '.titleLine .firstLetter', forceSingleLine: true, ratios:itcRatiosAry });
	sIFR.replace(tyfa, { css:'.sIFR-root { margin-left:0px; text-transform:uppercase; }', selectable:false, selector: '.titleLine .end', wmode: 'transparent', forceSingleLine: true, ratios:itcRatiosAry });
}
	
startList = function() {
	if (document.all&&document.getElementById) {
		navRoot = document.getElementById("nav");
		for (i=0; i<navRoot.childNodes.length; i++) {
			node = navRoot.childNodes[i];
			if (node.nodeName=="LI") {
				node.onmouseover=function() {
					this.className+=" over";
				}
				node.onmouseout=function() {
					this.className=this.className.replace(" over", "");
				}
			}
		}
	}
}
	
createDropCaseSpans = function(el){	
	var txt = trim11(el.firstChild.nodeValue);
	var start = txt.substring(0,1);
	var end = txt.substring(1);
	//alert('ho '+ start + ", " + end);
	// split out into spans
	var newTxt = '<span class="firstLetter">'+start+'</span><span class="end">'+end+'</span>';
	//el.className = el.className + ' clearFix';
	el.innerHTML = newTxt;
}

// thanks to steven levithan -> http://blog.stevenlevithan.com/archives/faster-trim-javascript ! 
trim11 = function(str) {
	str = str.replace(/^\s+/, '');
	for (var i = str.length - 1; i >= 0; i--) {
		if (/\S/.test(str.charAt(i))) {
			str = str.substring(0, i + 1);
			break;
		}
	}
	return str;
}


window.onload = initPage;