// FADE UP MODAL


function FadeUp(theLink, flashId, selected, catId, contentId, typeId ) {
	Spry.$$("#modaltable").removeClassName("display");
	Spry.$$("#veil").removeClassName("display");
	Spry.$$("#veil").setStyle("visibility:visible");
	Spry.$$("#popup").setStyle("visibility:visible");
	Spry.Utils.updateContent('popup_content', theLink);
	setTimeout('addFlash ('+flashId+','+selected+','+catId+','+contentId+','+typeId+')', 1000);
	}


// FADE DOWN MODAL

function FadeDown() {
	
	
	
		
	Spry.$$("#veil").setStyle("visibilty: hidden");
	Spry.$$("#modaltable").setStyle("visibilty: hidden");
	Spry.$$("#popup").setStyle("visibility:hidden");
	Spry.$$("#modaltable").addClassName("display");
	Spry.$$("#veil").addClassName("display");
	
	}


function closeFlash() {
	
		
	var theFlash
	if(navigator.appName.indexOf("Microsoft") != -1)
		{
		theFlash = window["FlashEmbed"];
     	} 
		else{
	 	theFlash = document["FlashEmbed"];
     	}
     	theFlash.stopAll();
		
	 var div = document.getElementById('popup_content');
	div.innerHTML = "";
	
   }

	
	
	
	
	
function addFlash (flashId, selected, catId, contentId, typeId) {
	
	
	Spry.$$("#flash_video").setStyle("display:block");

	
// EMBED FLASH VIDEO PLAYER
var flashvars = {
	theselected: selected,
	category_id: catId,
	content_id: contentId,
	type_id: typeId
	
	};
	
var params = {
  menu: "false",
  quality: "high",
  allowScriptAccess: "always"
}; 

var attributes = {
  id: "FlashEmbed",
  name: "FlashEmbed"
};


	if (flashId == 1 ) {
	swfobject.embedSWF('images/homevideo.swf', "flash_video", "920", "525", "8.0.0","", flashvars, params, attributes);
	}
	
	if (flashId == 2 ) {
	swfobject.embedSWF('images/video.swf', "flash_video", "920", "525", "8.0.0","", flashvars, params, attributes);
	}
	
	if (flashId == 3 ) {
	swfobject.embedSWF('images/image.swf', "flash_video", "920", "525", "8.0.0","", flashvars, params, attributes);
	}
	
	if (flashId == 4 ) {
	swfobject.embedSWF('images/audio.swf', "flash_video", "920", "525", "8.0.0","", flashvars, params, attributes);
	}
	

	
}

	

// DROP DOWN MENUS FOR IE6---Courtesy "A List Apart"

startList = function() {
if (document.all&&document.getElementById) {
navRoot = document.getElementById("navbar");
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", "");
   }
   }
  }
 }
}
window.onload=startList;

