function openWindow(obj,n,w,h,options,center){
	if (obj.getAttribute("HREF")) {
		if (center == "yes" || center == 1) {
			scWidthCenter = screen.availWidth / 2;
			scHeightCenter = screen.availHeight / 2;
			options2 = ",left=" + (scWidthCenter - (w / 2)) + ",top=" + (scHeightCenter - (h / 2));
		} else {
			options2 = "";
		}
		url = obj.getAttribute("HREF");
		w = window.open(url,n,"width=" + w + ",height=" + h + "," + options + options2);
		w.focus();
		return false;
	} else {
		return true;
	}
}

function closeWindow(){
	w = (parent)?parent:this;
 	w.window.close();
 	return false;
}

function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins && plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}

function initSwf(f,w,h,n) {
	var oeTags = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"'
	 + 'width="' + w + '" height="' + h + '" id="' + n + '"'
	 + 'codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab">'
	 + '<param name="allowScriptAccess" value="always" />'
	 + '<param name="movie" value="' + f + '" />'
	 + '<param name="loop" value="false" />'
	 + '<param name="menu" value="false" />'
	 + '<param name="quality" value="high" />'
	 + '<param name="wmode" value="transparent" />'
	 + '<param name="swliveconnect" value="true" />'
	 + '<embed src="' + f + '" width="' + w + '" height="' + h + '" id="' + n + '" name="' + n + '" '
	 + 'type="application/x-shockwave-flash" '
	 + 'allowScriptAccess="always" '
	 + 'loop="false" '
	 + 'menu="false" '
	 + 'quality="high" '
	 + 'wmode="transparent" '
	 + 'swliveconnect="true" '
	 + 'pluginspage="http://www.macromedia.com/go/getflashplayer">'
	 + '<\/embed>'
	 + '<\/object>';
	document.write(oeTags); 
}

function Bnrs(p) {
	this.w = $('bnrs-area').offsetWidth;
	this.p = 0;
	this.tx = 0;
	this.pages = p;
	this.timer = null;
	Event.observe($('bnrs-prev'), 'click', this.prev.bind(this), false);
	Event.observe($('bnrs-next'), 'click', this.next.bind(this), false);
	this.update(false);
}

Bnrs.prototype.update = function(scr) {
	//$('bnrs-inner').style.left = -((this.p*this.w)+((this.p==0)?0:5)) + "px";
	this.tx = -((this.p*this.w)+((this.p==0)?0:5));
	if (this.p == 0) {
		Element.addClassName($('bnrs-prev'),"disabled");
	} else {
		Element.removeClassName($('bnrs-prev'),"disabled");
	}
	if (this.p == this.pages-1) {
		Element.addClassName($('bnrs-next'),"disabled");
	} else {
		Element.removeClassName($('bnrs-next'),"disabled");
	}
	if (scr) this.timer = new PeriodicalExecuter(this.scroll.bind(this), 0.05);
}

Bnrs.prototype.prev = function() {
	if (!Element.hasClassName($('bnrs-prev'),"disabled")) {
		this.p--;
		this.update(true);
	}
}

Bnrs.prototype.next = function() {
	if (!Element.hasClassName($('bnrs-next'),"disabled")) {
		this.p++;
		this.update(true);
	}
}

Bnrs.prototype.scroll = function() {
	var cx = $('bnrs-inner').offsetLeft;
	if (Math.floor(Math.abs(this.tx - cx)) >0) {
		$('bnrs-inner').style.left = cx + ((this.tx - cx)*0.8) + "px";
	} else {
		$('bnrs-inner').style.left = this.tx + "px";
		this.timer.stop();
		this.timer = null;
	}
}


function resize() {
;
	var h = document.body.offsetHeight;
	
	if (h<560 && document.getElementById("header").currentStyle.height != "280px") {
		document.getElementById("header").style.height = "280px";
	} else if (h>560) {
		document.getElementById("header").style.height = "50%";
	}
}

function initIndex() {
	urchinTracker('/swf/index.swf');
}
