/*============================================================================================*/ function N_functions() {

/*===================================================================================================================*/ };

N_UA = function() {
	var  nUA = navigator.userAgent, D = document;
	this.SMd = (D.compatMode == "CSS1Compat")           ? 1 : 0;
	this.DOM = D.getElementById ? (D.getAttributeNS ? 2 : 1): 0;
	this.Mac = (nUA.indexOf("Mac") > -1)                ? 1 : 0;
	this.Sa  = (nUA.indexOf("Safari") > -1)             ? 1 : 0;
	this.Ge  = (nUA.indexOf("Gecko/") > -1)             ? 1 : 0;
	this.Op  = window.opera                             ? 1 : 0;
	this.IE  = (D.all && !this.Op)                      ? 1 : 0;
	this.IE  = this.IE ? ((this.DOM > 1) ? 7 : ((this.DOM && this.SMd) ? 6 : ((this.DOM && !this.SMd) ? 5 : 4))) : 0;
}

N_FP = function() {
	this.version = new Array(0,0,0);
	if(navigator.plugins && navigator.mimeTypes.length) {
		var fPI = navigator.plugins["Shockwave Flash"];
		if(fPI && fPI.description) this.version = fPI.description.replace(/^[^\d]+(\d+\.\d+)\s*(r(\d+))*\.*$/, "$1.$3").split(".")[0];
	}else{
		var fAX = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
		if(fAX) this.version = fAX.GetVariable("$version").split(" ")[1].split(",")[0];
	}
	this.checkVersion = function(R) {
		if(this.version < R) return 0;
		else                 return 1;
	}
	this.getHTML = function() {
		var Ps = new Array();
		for(var i = 0; i < arguments.length; i++) {
			var PA = arguments[i].split("=");
			if(PA[0] == "swf") PA[0] = "movie";
			Ps[PA[0]] = PA[1];
		}
		var               O  = "<object"
		                    +  " classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\""      ;
		if(Ps["width"])   O += " width=\""                         + Ps["width"]   + "\""     ;
		if(Ps["height"])  O += " height=\""                        + Ps["height"]  + "\""     ;
		                  O += ">";
		if(Ps["movie"])   O += "<param name=\"movie\"   value =\"" + Ps["movie"]   + "\">\n\t";
		if(Ps["bgcolor"]) O += "<param name=\"bgcolor\" value =\"" + Ps["bgcolor"] + "\">\n\t";
		if(Ps["quality"]) O += "<param name=\"quality\" value =\"" + Ps["quality"] + "\">\n\t";
		                  O += "<embed"
		                    +  " type=\"application/x-shockwave-flash\""                      ;
		if(Ps["movie"])   O += " src=\""                           + Ps["movie"]   + "\""     ;
		if(Ps["width"])   O += " width=\""                         + Ps["width"]   + "\""     ;
		if(Ps["height"])  O += " height=\""                        + Ps["height"]  + "\""     ;
		if(Ps["bgcolor"]) O += " bgcolor=\""                       + Ps["bgcolor"] + "\""     ;
		if(Ps["quality"]) O += " quality=\""                       + Ps["quality"] + "\""     ;
		return           (O += ">"
		                    +  "</embed>"
		                    +  "</object>")                                                   ;
		
	}
	this.setFlash = function(ID, F, V, W, H, B, M) {
		if(this.checkVersion(V)) {
			var fA = document.getElementById(ID);
			if(!fA) return;
			var sF = function() { fA.innerHTML = FP.getHTML("movie=" + F, "width=" + W, "height=" + H, "bgcolor=" + B, "menu=" + M, "quality=high"); };
			fA.innerHTML = "";
			var dT = UA.Sa ? 100 : 10;
			setTimeout(sF, dT);
		}
	}
}

var UA = new N_UA();
var FP = new N_FP();


//------------------------------------------------------------------------------------------------------------------------

document.getElementsByClassName = function(Cs) {
	var Es = new Array();
	var Cs = Cs.split(",");
	var aE = document.getElementsByTagName("*") ;
	for(var i = 0; i < Cs.length; i ++) {
		for(var j = 0; j < aE.length; j ++) {
			var cNs = aE[j].className.split(" ");
			if(Cs[i].indexOf(" ") > -1) {
				var cNsStr = " " + cNs.sort().join(" ") + " ";
				var argStr = " " + Cs[i].split(" ").sort().join(" ") + " ";
				if(cNsStr.indexOf(argStr) > -1) Es.push(aE[j]);
			}else for(var k = 0; k < cNs.length; k ++) if(cNs[k] == Cs[i]) { Es.push(aE[j]); break; }
		}
	}
	return Es;
}

//------------------------------------------------------------------------------------------------------------------------

if(Array.prototype.push == null) Array.prototype.push = function(E) { this[this.length] = E; return this.length; }

if(UA.IE && UA.IE < 8) {
	function N_eOb(e) {
		this.target = e.srcElement;
	}
	function N_ELM(a) {
		if(UA.Mac) {
			if(a) return function(Ev, F) { this["on" + Ev] = function() { return F(new N_eOb(event)); }; };
			else  return function(Ev   ) { this["on" + Ev] = function() { return; }; };
		}else{
			if(a) return function(Ev, F) { this.attachEvent("on" + Ev, function() { return F(new N_eOb(event)); }); };
			else  return function(Ev, F) { this.detachEvent("on" + Ev, F); };
		}
	}
	window.addEventListener    = document.addEventListener    = N_ELM(1);
	window.removeEventListener = document.removeEventListener = N_ELM(0);
}

N_defaults = function() {
	if(UA.DOM && UA.IE && UA.IE < 8) {
		var allElements = document.getElementsByTagName("*");
		for(var i = 0; i < allElements.length; i ++) if(!allElements[i].addEventListener) {
			allElements[i].addEventListener    = N_ELM(1);
			allElements[i].removeEventListener = N_ELM(0);
		}
	}
	N_functions();
}

//------------------------------------------------------------------------------------------------------------------------

N_setFlash = function() {
	FP.setFlash("featured", "/top.swf", 8, 800, 420, "#000000", "false");
}

N_setFlash_mF = function(M, F) {
	if(FP.checkVersion(8)) {
		var fA = document.getElementById("featured");
		fA.style.backgroundColor = "white";
		fA.style.padding = "0";
		fA.style.width = "720px";
	}
	FP.setFlash("featured", "/" + M + "/images/featured/" + F + ".swf", 8, 720, 345, "#FFFFFF", "false");
}

N_setFlash_pF = function(F, W, H) {
	if(FP.checkVersion(8)) {
		var fA = document.getElementById("featured");
		fA.style.backgroundColor = "white";
		fA.style.padding = "0";
		fA.style.width = W +"px";
		fA.style.height = H +"px";
	}
	FP.setFlash("featured", F, 8, W, H, "#FFFFFF", "false");
}

//------------------------------------------------------------------------------------------------------------------------

window.onload = N_defaults; 

//========================================================================================================================