$(document).ready(function()
{
	// Hide all the tooltips
	$("#jquery li").each(function() {
		$("a strong", this).css("opacity", "0");
	});
	
	$("#jquery li").hover(function() { // Mouse over
		$(this)
			.stop().fadeTo(500, 1)
			.siblings().stop().fadeTo(500, 0.2);
			
		$("a strong", this)
			.stop()
			.animate({
				opacity: 1,
				top: "-10px"
			}, 300);
		
	}, function() { // Mouse out
		$(this)
			.stop().fadeTo(500, 1)
			.siblings().stop().fadeTo(500, 1);
			
		$("a strong", this)
			.stop()
			.animate({
				opacity: 0,
				top: "-1px"
			}, 300);
	});
	
});

window.onload=(function(){if(window.frames.myIFrame)window.frames.myIFrame.location = "content_includes/landing.html";});

var dataFile = new Array("content_includes/about_import.html", "content_includes/program_import.html", "content_includes/sponsors_import.html", "content_includes/presenter_import.html");
var index = -1; 
function fillDiv() {
  if(index < 0) return;
  var x = window.frames.myIFrame.document;
  document.getElementById('content').innerHTML = x.body.innerHTML;
}

function btnHandler(i){
//  alert("inside >> btnHandler(" +i+ ")     dataFile[" +i+ "] = " +dataFile[i]);
  window.frames.myIFrame.location = dataFile[i];
  index = i;
  fillDiv();
}

function toggleFrame(){
	var x = document.getElementById("iframeDiv");
	if(x.style.display == "none"){
		x.style.display = "block";
		return;
	}
	x.style.display = "none";
}

function mangle() {
  if (!document.getElementsByTagName && !document.createElement &&
    !document.createTextNode) return;
  var nodes = document.getElementsByTagName("span");
  for(var i=nodes.length-1;i>=0;i--) {
    if (nodes[i].className=="change") {
      var at = /at/;
      var dot = /dot/g;
      var address = nodes[i].firstChild.nodeValue.split(" ").join("");
      var node = document.createElement("a");

      address = address.replace(at, "@");
      address = address.replace(dot, ".");
      node.setAttribute("href", "mailto:"+address);
      node.appendChild(document.createTextNode(address));

      var parent = nodes[i].parentNode;
      for(var j=0;j<parent.childNodes.length;j++)
        if (parent.childNodes[j] == nodes[i]) {
          if (!parent.replaceChild) return;
          parent.replaceChild(node, parent.childNodes[j]);
          break;
        }
    }
  }
}

