// fireclick flash
function call_fc_flash (arg1,arg2) {
	if(typeof(fc_flash) == "function") {
		fc_flash(arg1,arg2);
	}
}

var ordnum = Math.random()*10000000000000000;

/* Extra stuff to enable nav hovers in lame IE */
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}

if (window.attachEvent) window.attachEvent("onload", sfHover);


/***** COOKIE FUNCTIONS *****/
// Check cookie to see if the cookie already exists
function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');

	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)==' ') c = c.substring(1,c.length);
		if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
	}
	return null;
}

// Write the cookie
function createCookie(name,value,days,related) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		var expires = "; expires="+date.toGMTString();
	} else {
		var expires = "";
	}

	document.cookie = name+"="+value+expires+"; path=/";
	if (related == 'team') {
		myTeamDisplay();
	}
}

// Delete the cookie
function eraseCookie(name) {
	createCookie(name,"",-1,'team');
}
function closeSponsor() {
	document.getElementById('sponsor').style.display = 'none';
}

/*  Pops Photo Gallery windows */		
function photoGallery(url, name) {window.open( url, name, 'toolbar=no,resizable=no,scrollbars=no,menubar=no,location=no,width=678,height=460,top=10,left=10' );}


/*******************************************************************
 * menu navigation script added by RRO
 *******************************************************************/
function goOn(newURL) {
  //--If the selected file name isn't blank, send it to reader.
  if (newURL != "") {
    location.href=newURL
  }
}

// brandolin's vodoo

/**
**  LA CHIAMO SOLO SU INTERNET EXPLORER
 **/
function checkIt(string)
{
	var detect = navigator.userAgent.toLowerCase();
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


ieHover = function() {
	var ieULs = document.getElementById('nav').getElementsByTagName('ul');
	
	if (checkIt('msie')) {
	
		/** IE script to cover <select> elements with <iframe>s **/
		for (j=0; j<ieULs.length; j++) {
			ieULs[j].innerHTML = ('<iframe src="about:blank" scrolling="no" frameborder="0"></iframe>' + ieULs[j].innerHTML);
			/*ieULs[j].innerHTML = ('<iframe id="iePad' + j + '" src="about:blank" scrolling="no" frameborder="0" style=""></iframe>' + ieULs[j].innerHTML);
			var ieMat = document.getElementById('iePad' + j + '');*/
			//	var ieMat = ieULs[j].childNodes[0];  alert(ieMat.nodeName); // also works...
			var ieMat = ieULs[j].firstChild;
			ieMat.style.width=ieULs[j].offsetWidth+"px";
			ieMat.style.height=ieULs[j].offsetHeight+"px";	
			ieULs[j].style.zIndex="99";
		}
		/** IE script to change class on mouseover **/
		var ieLIs = document.getElementById('nav').getElementsByTagName('li');
		for (var i=0; i<ieLIs.length; i++) if (ieLIs[i]) {
			ieLIs[i].onmouseover=function() {this.className+=" iehover";}
			ieLIs[i].onmouseout=function() {this.className=this.className.replace(' iehover', '');}
		}
		
	}
	
}


if (window.attachEvent) window.attachEvent('onload', ieHover);
