var is = new browserCheck();
var imgExt = ".gif", screenWidth, screenHeight;
var myLayers = new Array ();
var thisAdrList = thisURL.split ("/"), menuHighlighted = false, menuDone = false;
if (template == "home") {
	menuDone = true};
var MENU_POS = {
	'height' : [20, 20, 20, 20, 20],'width' : [100, 150, 150, 150, 150],'block_top' : [0, 22, 16, 10, 10],'block_left' : [0, 0, 40, 140, 160, 180],'top' : [0, 20, 20, 21, 21],'left' : [101, 0, 0, 0, 0],'hide_delay' : [200, 200, 200, 200, 200],'expd_delay' : [200, 200, 200, 200, 200],'pixel_path' : 'images/template/pixel.gif'};
function getMyLayers () {
	var children = document.body.childNodes;
	for (var ct=0;ct<children.length;ct++) {
		if (children[ct].nodeName.toLowerCase() == "div") {
			myLayers[myLayers.length] = children[ct].id}}};
function browserCheck() {
	var b = navigator.appName;
	this.agent = window.navigator.userAgent;
	this.win = (this.agent.indexOf('Win')>0);
	this.mac = (this.agent.indexOf('Mac')>0);
	switch (b) {
		case "Netscape": this.b = "ns"; break;
		case "Microsoft Internet Explorer": this.b = "ie"; break;
		default: this.b = b};
	this.version = navigator.appVersion;
	this.v = parseInt(this.version);
	this.ns = (this.b=="ns" && this.v>=4);
	this.ns4 = (this.b=="ns" && this.v==4);
	this.ns5 = (this.b=="ns" && this.v==5);
	this.ie = (this.b=="ie" && this.v>=4);
	this.ie4 = (this.version.indexOf('MSIE 4')>0);
	this.ie5 = (this.version.indexOf('MSIE 5')>0);
	this.min = (this.ns||this.ie);
	if (this.ns4) {
		var d = document; var w = window;
		if (typeof d.cs == 'undefined') {
			d.cs = new Object;
			d.cs.csFix = new Object};
		d.cs.csFix.w = w.innerWidth;
		d.cs.csFix.h = w.innerHeight;
		window.onresize = NSFixFct}};
function NSFixFct() {
	var d = document; var w = window;
	if (d.cs.csFix.w != w.innerWidth || d.cs.csFix.h != w.innerHeight) {
		d.location = d.location}};
function clickReturn () {
	if (is.ie && (is.agent.indexOf("Mozilla/3") >= 0) && (is.mac)) {
		return true}
	else {
		return false}};
function layerObj (id) {
	this.id = id;
	this.obj = findLayer (this.id);
	if (is.ns4) {
		this.x = this.obj.left;
		this.y = this.obj.top}
	else {
		this.x = this.obj.offsetLeft;
		this.y = this.obj.offsetTop};
	this.pos_x = this.x;
	this.pos_y = this.y;
	this.write = writeLayer;
	this.clip = clipLayer;
	this.getWidth = getWidth;
	this.getHeight = getHeight;
	this.setHeight = setHeight;
	this.getClip = getClipValue;
	this.moveTo = moveLayerTo;
	this.moveBy = moveLayerBy;
	this.alignMiddle = alignMiddle;
	this.show = show;
	this.hide = hide};
function navObj (id) {
	this.id = id + "NavObj";
	eval (this.id+"=this");
	this.image = new imageObj (id.replace (/__/g, '_:'), new Array ("current", "x"), "navigation");
	this.over = new Function (this.id + '.image.set (' + this.id + '.image.x.src)');
	this.out = new Function (this.id + '.image.set (' + this.id + '.image.current.src)')};
function textObj (id, w, h, show) {
	this.id = id + "TextObj";
	eval(this.id+"=this");
	this.layer = new layerObj (id);
	this.layer.w = this.layer.getWidth ();
	this.layer.h = this.layer.getHeight ();
	if (w == null) {
		w = this.layer.w};
	if (h == null) {
		h = this.layer.h};
	if (show) {
		this.layer.show ()}};
function imageObj (id, preloads, urlprefix) {
	if (urlprefix == null) {
		this.url = "template/" + id.replace (/:/g, '/')}
	else {
		this.url =  urlprefix + "/" + id.replace (/:/g, '/')};
	if (is.ns4) {
		this.obj = findElement(id,0)}
	else {
		this.obj = document.images[id]};
	for (var ct=0;ct<preloads.length;ct++) {
		var suffix = "_" + preloads[ct];
		if (preloads[ct] == "_") {
			suffix = ""};
		this[preloads[ct]] = new Image ();
		if (preloads[ct] != "current") {
			this[preloads[ct]].src = imgprefix + "images/" + this.url + suffix + ".gif"}
		else {
			this[preloads[ct]].src = this.obj.src}};
	this.set = setImage};
function findElement(name, layer) {
	if (is.version < 4) {
		return document[name]};
	if (is.v == 4) {
		var curDoc = layer ? layer.document : document, elem = curDoc[name];
		if (!elem) {
			for (var i=0;i<curDoc.layers.length;i++) {
				elem = findElement (name, curDoc.layers[i]);
				if (elem) {
					return elem}}}}
	else {
		elem = document.getElementById (name)};
	return elem};
function findLayer (name) {
	if (is.ie) {
		return document.all.tags("div")[name]}
	else {
		return findElement(name,0)}};
function setImage (url) {
	this.obj.src = url};
function getWidth () {
	if (is.ns4) {
		return this.obj.clip.width}
	else if (is.ie) {
		return (is.ie4)? this.obj.style.pixelWidth :  this.obj.offsetWidth}
	else {
		return parseInt (this.obj.scrollWidth)};
	return -1};
function getHeight () {
	if (is.ns4) {
		return this.obj.clip.height}
	else if (is.ie) {
		return this.obj.clientHeight}
	else {
		return parseInt (this.obj.scrollHeight)};
	return -1};
function setHeight (value) {
	if (is.ns4) {
		this.obj.document.height = value}
	else {
		this.obj.style.height = value};
	return true};
function writeLayer (html) {
	if (is.ns4) {
		this.obj.document.open ();
		this.obj.document.write (html);
		this.obj.document.close ()}
	else {
		this.obj.innerHTML = html}};
function moveLayerTo (x, y) {
	if (x!=null) {
		this.x = x;
		if (is.ie) {
			 this.obj.style.pixelLeft = this.x}
		else {
			if (is.ns4) {
				this.obj.left = this.x}
			else {
				this.obj.style.left = this.x}}};
	if (y!=null) {
		this.y = y;
		if (is.ie) {
			 this.obj.style.pixelTop = this.y}
		else {
			if (is.ns4) {
				this.obj.top = this.y}
			else {
				this.obj.style.top = this.y}}}};
function moveLayerBy (dx, dy) {
	this.moveTo(this.x+dx,this.y+dy)};
function clipLayer(cliptop, clipright, clipbottom, clipleft) {
	if (is.ns4) {
		this.obj.clip.left  = clipleft;
		this.obj.clip.top = cliptop;
		this.obj.clip.right = clipright;
		this.obj.clip.bottom = clipbottom}
	else {
		this.obj.style.clip = 'rect(' + cliptop + ' ' +  clipright + ' ' + clipbottom + ' ' + clipleft +')';}};
function getClipValue (which) {
	if (is.ns4) {
		return this.obj.clip[which]}
	else {
		if (this.obj.style.clip) {
			var clip = getIEClipValues(this.obj.style.clip);
			switch (which) {
				case "top": return clip[0];
				case "right": return clip[1];
				case "bottom": return clip[2];
				case "left": return clip[3]}}};
	return 0};
function getIEClipValues(str) {
	var clip = new Array();
	var i;
	i = str.indexOf("(");
	clip[0] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[1] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[2] = parseInt(str.substring(i + 1, str.length), 10);
	i = str.indexOf(" ", i + 1);
	clip[3] = parseInt(str.substring(i + 1, str.length), 10);
	return(clip)};
function show () {
	if (is.ns4) {
		this.obj.visibility = 'show'}
	else {
		this.obj.style.visibility = "visible"}};
function hide () {
	if (is.ns4) {
		this.obj.visibility = 'hide'}
	else {
		this.obj.style.visibility = "hidden"}};
function alignMiddle () {
	var pageWidth = 784, leftIndent = 0;
	if (is.ie) {
		leftIndent = (document.body.clientWidth-pageWidth)/2 + 8}
	else {
		leftIndent = (window.innerWidth-pageWidth)/2};
	leftIndent = leftIndent + this.pos_x;
	if (leftIndent < this.pos_x) {
		leftIndent = this.pos_x};
	this.moveTo (leftIndent, this.y)};
function alignLayers() {
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = eval(myLayers[ct] + "TextObj");
		myObj.layer.alignMiddle ()}};
function wrap1(text, url) {
	var flActive = true, styleExtra = "";
	var adrList = url.split ("/");
	var depth = adrList.length - 1;
	if (!menuHighlighted || (menuHighlighted && depth > 1)) {
		if (depth > 0) {
			if (adrList[depth] == "index.html") {
				depth = depth -1};
			for (var ct=0;ct<=depth;ct++) {
				if (adrList[ct] != thisAdrList[ct]) {
					flActive = false;
					break}}}
		else {
			flActive = false}}
	else {
		flActive = false};
	if (flActive) {
		menuHighlighted = true;
		styleExtra =  "background-color:#2b5da2;"};
	htmltext =  "<table cellpadding='0' cellspacing='0' border='0' style='width:100%'><tr><td class='menulink' style='padding-left:3px;" + styleExtra + "'>" + text + "</td></tr></table>";
	return htmltext};
function wrap(text, activeURL) {
	var styleExtra = "";
	if (!menuDone) {
		if (menuHighlighted) {
			matches = activeURL.split ("/");
			if (matches.length == 2 && matches[matches.length-1] == "") {
				menuDone = true}};
		if (activeURL != "") {
			if (activeURL == thisURL.substr(0, activeURL.length)) {
				styleExtra =  "background-color:#2b5da2;";
				menuHighlighted = true}}};
	htmltext =  "<table cellpadding='0' cellspacing='0' border='0' style='width:100%'><tr><td class='menulink' style='padding-left:3px;" + styleExtra + "'>" + text + "</td></tr></table>";
	return htmltext};
function revealLayer(dir) {
	var edge, limit;
	switch (dir) {
		case "right": {
			var edge = this.inc*this.step, limit = this.layer.w;
			this.layer.clip (0,edge,this.layer.h, 0);
			break};
		case "left": {
			var edge = -(this.layer.w-(this.inc*this.step)), limit = 0;
			this.layer.clip (0,this.layer.w,this.layer.h,-edge);
			break}};
	if (edge < limit) {
		myTimer = setTimeout (this.id + '.reveal("' + dir + '")', 20)}
	else {
		this.inc = 0;
		myTimer = setTimeout (this.id + '.conceal("' + dir + '")', 1000)};
	this.inc++};
function concealLayer (dir) {
	var edge, limit;
	switch (dir) {
		case "right": {
			var edge = this.layer.w - this.inc*this.step, limit = 0;
			this.layer.clip (0,edge,this.layer.h, 0);
			break};
		case "left": {
			var edge = -(this.inc*this.step), limit = -this.layer.w;
			this.layer.clip (0,this.layer.w,this.layer.h,-edge);
			break}};
	if (edge > limit) {
		myTimer = setTimeout (this.id + '.conceal("' + dir + '")', 20)}
	else {
		this.inc = 0};
	this.inc++};
function revealLayer2(dir) {
	var edge = this.inc*this.step, limit = this.layer.w;
	switch (dir) {
		case "right": {
			this.layer.moveTo (this.layer.pos_x+edge, null);
			this.layer.clip (0, this.layer.w,this.layer.h,this.layer.w-edge);
			concealDir = "left";
			break};
		case "left": {
			this.layer.moveTo (this.layer.pos_x-edge, null);
			this.layer.clip (0,edge,this.layer.h,0);
			concealDir = "right";
			break}};
	if (edge < limit) {
		myTimer = setTimeout (this.id + '.reveal("' + dir + '")', 30);
		this.inc++}
	else {
		this.inc = 0;
		myTimer = setTimeout (this.id + '.conceal("' + concealDir + '")', 1000)}};
function concealLayer2(dir) {
	var edge =  this.inc*this.step, limit = this.layer.w;
	switch (dir) {
		case "right": {
			this.layer.moveTo (this.layer.pos_x - this.layer.w + edge, null);
			this.layer.clip (0,this.layer.w-edge,this.layer.h,0);
			break};
		case "left": {
			this.layer.moveTo (-edge, null);
			this.layer.clip (0, this.layer.w,this.layer.h,this.layer.w-edge);
			break}};
	if (edge < limit) {
		myTimer = setTimeout (this.id + '.conceal("' + dir + '")', 20)}
	else {
		this.inc = 0};
	this.inc++};
function showTiger (side, imageName) {
	var myObj = eval("_tiger" + side + "TextObj"), revealDir;
	if (side == "Left") {
		revealDir = "right";
		myObj.layer.pos_x = 0;
		imageName = imageName + "_l"}
	else {
		revealDir = "left";
		myObj.layer.pos_x = screenWidth-myObj.layer.w;
		imageName = imageName + "_r"};
	myObj.layer.write ("<img src='" + homeprefix + "images/template/jt/" + imageName + ".gif' name='jt:mascotte' border='0'><br />");
	var hPos = Math.random()*(screenHeight - myObj.layer.h);
	myObj.layer.clip (0,0,0,0);
	myObj.layer.moveTo(myObj.layer.pos_x, hPos);
	myObj.layer.show();
	myObj.reveal (revealDir)};
function startMascotte () {
	var interval = 10000 + Math.random()*10000;
	var sides = new Array ("Left", "Right");
	var mascottes = new Array ("zetEmOp", "comeOn");
	showTiger (sides[Math.floor(Math.random()*sides.length)], mascottes[Math.floor(Math.random()*mascottes.length)]);
	setTimeout ("startMascotte()", interval)};
function writeBanners () {
	if (banners_local != "") {
		document.write(banners_local)}
	else {
		if (template.substr(0,3) == "jt_") {
			document.write(jt_banners_global);
			for (var ct=0;ct<nav_jt_banners.length;ct++) {
				new navObj (nav_jt_banners[ct])}}
		else {
			document.write(banners_global)}}};
function correctRetardedIE() {
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG") {
			var imgID = (img.id) ? "id='" + img.id + "' " : "";
			var imgClass = (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
			var imgStyle = "display:inline-block;" + img.style.cssText;
			if (img.align == "left") imgStyle = "float:left;" + imgStyle;
			if (img.align == "right") imgStyle = "float:right;" + imgStyle;
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
			 var strNewHTML = "<span " + imgID + imgClass + imgTitle + " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
			if (img.useMap) {
				strNewHTML += "<div style=\"position:absolute;top:0px;left:0px;z-index:2000;width:780px;text-align:center;\"><img src=\"" + homeprefix + "images/template/spacer.gif\"  style=\"" + "width:" + img.width + "px; height:" + img.height + "px;\" usemap=\"" + img.useMap + "\"></div>"};
			img.outerHTML = strNewHTML;
			 i = i-1;
			}}};
function zoom(imgName) {
	var s = "<a href='javascript:unzoom()'><img src='" + homeprefix + "images/" + imgName.substr(0,1) + "/" + imgName + "' border='0' vspace='5' hspace='5'/></a>";
	_zoomTextObj.layer.write (s);
	_zoomTextObj.layer.show ();
	_zoom_lockTextObj.layer.show ()};
function unzoom() {
	_zoomTextObj.layer.write ("");
	_zoomTextObj.layer.hide ();
	_zoom_lockTextObj.layer.hide ()};
function hasSeenPopUp () {
	var allCookies = document.cookie.split(";");
	for (var ct=0 ; ct < allCookies.length ; ct++) {
		var myCookie = allCookies[ct].split("=");
		myCookie[0].substring(0,1)==' '?myCookie[0]=myCookie[0].substring(1,myCookie[0].length):void(0);
		if (myCookie[0]=='popUp') {
			return true}};
	return false};
function showPopUp () {
	document.cookie = "popUp=true;path=/";
	_overlayTextObj.layer.show ()};
function hidePopUp () {
	_overlayTextObj.layer.hide ()};
function create() {
	getMyLayers ();
	window.onresize = alignLayers;
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = new textObj (myLayers[ct], null, null, false);
		myObj.layer.pos_x = myObj.layer.x;
		myObj.layer.pos_y = myObj.layer.y;
		myObj.layer.alignMiddle ()};
	if (is.ie) {
		correctRetardedIE ()}};
function init() {
	for (var ct=0;ct<myLayers.length;ct++) {
		myObj = eval(myLayers[ct] + "TextObj");
		if (myLayers[ct].substr (0,1) != "_") {
			myObj.layer.show ()}
		else {
			if (myLayers[ct].substr (0,6) == "_tiger") {
				myObj.reveal = revealLayer;
				myObj.conceal = concealLayer;
				myObj.step = 20;
				myObj.inc = 0}}};
	for (var ct=0;ct<nav.length;ct++) {
		new navObj (nav[ct])};
	if (template.substr(0,3) == "jt_") {
		if (is.ie) {
			screenWidth = document.body.clientWidth;
			screenHeight = document.body.clientHeight}
		else {
			screenWidth = window.innerWidth;
			screenHeight = window.innerHeight};
		setTimeout ("startMascotte()", Math.random()*1000)};
	if (template == "home" && pageHasPopUp) {
		if (!hasSeenPopUp()) {
			showPopUp ();
			setTimeout ("hidePopUp ()", 12000)}};
	initialized = true};
function openPopup(wURL, wName, wWidth, wHeight, wRes, wScroll) {
	var winl = (screen.width-wWidth)/2-10;
	var wint = (screen.height-wHeight)/2-10;
	var params = 'top='+wint+',left='+winl+'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars='+wScroll+',';
	params += 'resizable='+wRes+',width='+wWidth+',height='+wHeight;
	var arr = window.open(wURL, wName, params);
	return arr};
function flash_fix() {
	theObjects = document.getElementsByTagName("object");
	for (var i = 0; i < theObjects.length; i++) {
		theObjects[i].outerHTML = theObjects[i].outerHTML}}
