//
//function CoMIT_Flash_ForceImages() 
//{
//
//	CoMIT_Flash_ForceImage = 1;
//	
//}
//
//function CoMIT_Flash_StopForceImages() 
//{
//
//	CoMIT_Flash_ForceImage = 0;
//	
//}
//
//
//function CoMIT_Flash_GetElementById(e){if(typeof(e)=='string'){if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null;}return e;}
//
//function CoMIT_ShowFlash(target_element, image_alternative, alt_tag, swf, id, w, h, ver ) {
////var CoMIT_Flash_ForceImage = 0;
//
//	CoMIT_Flash_GetElementById(target_element).innerHTML = "<IMG SRC='" + image_alternative + "' WIDTH=" + w + " HEIGHT=" + h + " alt='" + alt_tag + "' />";
//
//	if (CoMIT_Flash_ForceImage==0) {
// 
// 		so = new SWFObject(swf, id, w, h, ver, "", "high");
//		so.addParam("wmode", "transparent");
//		so.write(target_element);
//		
//	} 
//
//
//}


function CoMIT_Flash_ForceImages() 
{

	CoMIT_Flash_ForceImage = 1;
	
}

function CoMIT_Flash_StopForceImages() 
{

	CoMIT_Flash_ForceImage = 0;
	
}


function CoMIT_Flash_GetElementById(e){if(typeof(e)=='string'){if(document.getElementById)e=document.getElementById(e);else if(document.all)e=document.all[e];else e=null;}return e;}

function CoMIT_ShowFlash(target_element, image_alternative, alt_tag, swf, id, w, h, ver ) {
var CoMIT_Flash_ForceImage=0;
	
	CoMIT_Flash_GetElementById(target_element).innerHTML = "<IMG SRC='" + image_alternative + "' WIDTH=" + w + " HEIGHT=" + h + " alt='" + alt_tag + "' />";

	if (CoMIT_Flash_ForceImage==0) {
 		
		var flashvars = {};
		var params = {};
		params.wmode = "transparent";
		var attributes = {};
		swfobject.embedSWF(swf, id, w, h, ver, "", flashvars, params, attributes);
		
	} 


}

function CoMIT_ShowFlash2(target_element, image_alternative, alt_tag, swf, id, w, h, ver ) {
var CoMIT_Flash_ForceImage=0;
//	debugger;
	CoMIT_Flash_GetElementById(target_element).innerHTML = "<IMG SRC='" + image_alternative + "' WIDTH=" + w + " HEIGHT=" + h + " alt='" + alt_tag + "' />";

	if (CoMIT_Flash_ForceImage==0) {
 		
		var flashvars = {};
		var params = {};
		params.wmode = "transparent";
		var attributes = {};
		swfobject.embedSWF(swf, id, w, h, ver, false, flashvars, params, attributes);
		
	} 


}

	//var flashvars = {};
//	flashvars.fLocation = "/Portals/_default/Skins/DUCOM/flash/research/Hline3D.flv";
//	var params = {};
//	params.wmode = "transparent";
//	var attributes = {};
//	swfobject.embedSWF("/Portals/_default/Skins/DUCOM/flash/research/video_player1.swf", "altContainer", "450", "300", "9.0.0", false, flashvars, params, attributes);



			//var flashvars = {};
//			var params = {};
//			var attributes = {};
//			swfobject.embedSWF("/Portals/0/MicrobiologyandImmunology/IMMID%20Text.swf",          "flashcontent", "380", "200", "9.0.0", false, flashvars, params, attributes);
	


// <![CDATA[

//	CoMIT_ShowFlash("flashcontent", "http://www.adobe.com/images/shared/download_buttons/get_flash_player.gif", "IMMID", "/Portals/0/MicrobiologyandImmunology/IMMID%20Text.swf", "IMMID Text", "380", "200", "9", "#FFFFFF");  // Standard call
							
// ]]>



//
// faders.js
//
// by Chris Klimas <klimas@gmail.com>
//
// A quick and mostly simple way of fading text without losing
// its anti-aliasing in Internet Explorer. This code is released
// under the terms of the Creative Commons Attribution-Share Alike
// 3.0 License: http://creativecommons.org/licenses/by-sa/3.0/
//

function fade (el, options)
{
	// el - the DOM element to fade
	//
	// options - an object with two properties:
	//
	//           fade - either 'in' or 'out', specifying the direction
	//           of the fade (required)
	//
	//           onComplete - a function to call after the fade
	//                        is done (optional)

	var current;
	var proxy = el.cloneNode(true);
	var direction = (options.fade == 'in') ? 1 : -1;
	
	el.parentNode.replaceChild(proxy, el);
	
	if (options.fade == 'in')
	{
		current = 0;
		proxy.style.visibility = 'visible';
	}
	else
		current = 1;

	setOpacity(proxy, current);	
	var interval = window.setInterval(tick, 25);
	
	function tick()
	{
		current += 0.05 * direction;
		
		setOpacity(proxy, current);
		
		if (((direction == 1) && (current >= 1))
				|| ((direction == -1) && (current <= 0)))
		{
			el.style.visibility = (options.fade == 'in') ? 'visible' : 'hidden';
			proxy.parentNode.replaceChild(el, proxy);
			delete proxy;
			window.clearInterval(interval);	
			
			if (options.onComplete)
				options.onComplete();
		}
	};
	
	function setOpacity (el, opacity)
	{						
		var percent = Math.floor(opacity * 100);
			
		// IE
		el.style.zoom = 1;
		el.style.filter = 'alpha(opacity=' + percent + ')';
					
		// CSS 3
		el.style.opacity = opacity;
	};
};

function CoMIT_Fade (el, options)
{

	fade (el, options);

}

function CoMIT_DoFade(a,b)
{

	if (b==1)

		CoMIT_Fade(xGetElementById(a), { fade:'in', onComplete: function() { intSemaphore = 0;}});

	else

		CoMIT_Fade(xGetElementById(a), { fade:'out' });

}

