/**
 * @author jean pierre carl VIGUER ( http://www.jpviguer.com )
 * 
 *         Creation : 2 avril 2009
 */
//////////////////////
// generic functions //
//////////////////////
function stopEvent(e) {
	if (isIE()) {
		window.event.returnValue = false;
		window.event.cancelBubble = true;
	} else {
		e.preventDefault();
		e.stopPropagation();
	}
}

function getEventSource(e) {
	if (isIE())
		return window.event.srcElement;
	else
		return e.target;
}

function isIE() {
	return ( navigator.appName.indexOf("Microsoft") != -1);
}

function setDisplay(divId, visible, text) {
	var div = document.getElementById(divId);
	if (div) {
		if (visible) {
			div.innerHTML = text;
			div.style.display = "block";
		} else {
			div.style.display = "none";
		}
	}
}

Array.prototype.indexOf = function(item) {
	for ( var i = 0; i < this.length; i++)
		if (this[i] == item)
			return i;
	return -1;
}

Array.prototype.deleteItem = function(name) {
	var cur = this.indexOf(name);
	if (cur >= 0) {
		this.splice(cur, 1);
	}
}

function insertEmail(){
	var spanemail = document.getElementById( "spanemail");
	var name = "carl";
	var site = "3dleds";
	var ext = "com";
	var spanContent = name + "@" + site + "." + ext;
	if ( spanemail ) {
		spanemail.innerHTML = "<a href='mailto:"+ spanContent +"'>"+ spanContent +"</a>";
	}
}

function insertLogo3dleds(){
	var divLogo3dleds = document.getElementById("divLogo3dleds");
	divLogo3dleds.innerHTML = "<object id=\"objectFlash\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\""
	+"codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\"128\" height=\"128\">"
	+"<param name=\"movie\" value=\"swf/Logo3dleds.swf\" />"
	+"<param name=\"quality\" value=\"high\" />"
	+"<param name=\"wmode\" value=\"Opaque\">"
	+"<embed name=\"objectFlash\" src=\"swf/Logo3dleds.swf\" quality=\"high\" wmode=\"Opaque\" type=\"application/x-shockwave-flash\""
	+"width=\"128\" height=\"128\"></embed></object>";
	var divTransparentLogo3dleds = document.getElementById("divTransparentLogo3dleds");
	divTransparentLogo3dleds.innerHTML = "<a href=\"http://3dleds.com\" title=\"return to main page of 3dleds.com\">"
		+"<img src=\"img/transparent.gif\" border=\"0\" width=\"160\" height=\"120\" class=\"logoImgTransparent\"></a>";
}


