function fnOpenWindow(url,parameters)
{
	parameters=parameters.replace(/\s+/g,'');

	var aParameters=parameters.split(',');
	var data=new Array();
	for (var i=0;i<aParameters.length;i++) {
		var pr=aParameters[i];
		var key = pr.substr(0,pr.indexOf('='));
		var value=pr.substr(pr.indexOf('=')+1);
		data[key]=value;
	}

	if ( (data['hposition'])&&(data['width'])&&(data['hposition']!='system') )
	{
		var posX=null;
		if (data['hposition']=='left')
		{
			posX=0;
		}
		if ( (window.screen)&&(window.screen.availWidth) )
		{
			if (data['hposition']=='center')
				posX=(window.screen.availWidth-data['width'])/2;
			if (data['hposition']=='right')
				posX=window.screen.availWidth-data['width'];
		}

		if (posX!=null)
			parameters+=",left="+parseInt(posX);
	}

	if ( (data['vposition'])&&(data['height'])&&(data['vposition']!='system') )
	{
		var posY=null;
		if (data['vposition']=='top')
		{
			posY=0;
		}
		if ( (window.screen)&&(window.screen.availHeight) )
		{
			if (data['vposition']=='center')
				posY=(window.screen.availHeight-data['height'])/2;
			if (data['vposition']=='bottom')
				posY=window.screen.availHeight-data['height'];
		}

		if (posY!=null)
			parameters+=",top="+parseInt(posY);
	}


	var oWnd=window.open(url,'',parameters);
	oWnd.focus();
}

function getById(el) {
	return document.getElementById(el);
}

function getByTag(par,el) {
	return par.getElementsByTagName(el);
}

function addClass(obj,newClass) {
	if(!obj.className.match(new RegExp(newClass)))
		obj.className+=(obj.className.length>0? " ": "") + newClass;
}
	
function removeClass(obj,oldClass) {
	obj.className=obj.className.replace(new RegExp("( ?|^)"+oldClass+"\\b"), "");
}

function setLinks(linkTags){
	var linkCollection = [];
	for (var j = 0; j < linkTags.length; j++) {
		linkCollection[j] = document.getElementsByTagName(linkTags[j]);
		for (var i = 0; i < linkCollection[j].length; i++) {
			if(/bookmark|external|corporate|sponsor/.test(linkCollection[j][i].getAttribute('rel'))) {
				linkCollection[j][i].onclick = function(e) {
					if (!e) var e = window.event;
					if (e.shiftKey || e.altKey || e.ctrlKey || e.metaKey)
						return true;
					window.open(this.href);
					return false;
				}
			}
		}
	}
}

var addEvent = function() {
  if (window.addEventListener) {
    return function(el, type, fn) {
      el.addEventListener(type, fn, false);
    };
  } else if (window.attachEvent) {
    return function(el, type, fn) {
      var f = function() {
        fn.call(el, window.event);
      };
      el.attachEvent('on' + type, f);
    };
  }
}();





function fixLowIe() {
	var techLiColl = getByTag(getById('technologies'),'li');
	for(var i = 0; i < techLiColl.length; i++) {
		// addEvent(getByTag(techLiColl[i],'span')[0], 'mouseover', function(e) {
		// 	addClass(this,'hover');
		// });
		getByTag(techLiColl[i],'span')[0].onmouseover = function () {
			addClass(this,'hover');
		}
		getByTag(techLiColl[i],'span')[0].onmouseout = function () {
			removeClass(this,'hover');
		}
	}
}


function setLowIeNav(){
	var nav = document.getElementById('navigation');
	if(!nav) return;
	if(nav.getElementsByTagName('li')[0]){
		var navLiCollection = nav.getElementsByTagName('li');
		for (var j = 0; j < navLiCollection.length; j++) {
			navLiCollection[j].onmouseover = function() {
				addClass(this,'hover');
			}
			navLiCollection[j].onmouseout = function() {
				removeClass(this,'hover');
			}
			if(navLiCollection[j].parentNode.parentNode.className=='sub'){
				if(navLiCollection[j].parentNode.parentNode.currentStyle.position=='absolute'){
					var ul = navLiCollection[j].getElementsByTagName('ul')[0];
					if(ul)
						ul.style.width = navLiCollection[j].clientWidth+'px';
				}
			}
		}
	}
	var els = document.getElementById('elements');
	if(!els) return;
	var elsLiColl = els.getElementsByTagName('span');
	for (var i = 0; i < elsLiColl.length; i++) {
		elsLiColl[i].onmouseover = function () {
			addClass(this,'hover');
		}
		elsLiColl[i].onmouseout = function () {
			removeClass(this,'hover');
		}
	}
}

function showAbstract(obj) {
	var id = obj.className;
	if(document.getElementById(id)) {
		obj.style.position='relative';
		if(document.all)
			obj.style.display='inline-block';
		var t = document.getElementById(id);
		
		if(!document.getElementById('x'+id)){
			var tip = t.cloneNode(true);
			tip.setAttribute('id','x'+id);
			obj.appendChild(tip);
		}
		else {
			var tip = document.getElementById('x'+id);
		}
		var x=-(obj.offsetWidth/3);
		if(/last/.test(obj.parentNode.parentNode.parentNode.parentNode.parentNode.className))
			x = +(obj.offsetWidth/3)-obj.offsetWidth-t.offsetWidth;
		tip.style.top = (-tip.offsetHeight+13)+"px";
		tip.style.left = (obj.offsetWidth+x)+"px";
	}
}

function hideAbstract(obj) {
	var id = 'x'+obj.className;
	if(document.getElementById(id)) {
		obj.style.position='static';
		if(document.all)
			obj.style.display='inline';
		var t = document.getElementById(id);
		t.style.left = "-9999px";
	}
}

function setFieldTable() {
	if(!document.getElementById('fields-table'))
		return;
	var ft = document.getElementById('fields-table');
	var h5Collec = ft.getElementsByTagName('h5');
	for (var i = 0; i < h5Collec.length; i++) {
		var pDiv = h5Collec[i].parentNode;
		if(pDiv.getElementsByTagName('div')[0]){
			var d = pDiv.getElementsByTagName('div')[0];
			if(/x/.test(d.className)){
				addClass(d,'off');
				d.setAttribute('id','xid'+i);
				var a = h5Collec[i].childNodes[0];
				a.setAttribute('class','xid'+i);
				if(document.all)
					a.className='xid'+i;
				a.onmouseover = function() {
					showAbstract(this);
				}
				a.onmouseout = function() {
					hideAbstract(this);
				}
			}
		}
	}
}

function fixIe() {
	var nav = document.getElementById('navigation');
	if(!nav) return;
	addClass(nav,'z200');
}


/* Init
-------------------- */
var init = function() {
	if (arguments.callee.done) return;
	arguments.callee.done = true;
	if(!document.getElementsByTagName)
		return;
	addClass(getById('page'),'scripted');
	setLinks(['a','area']);
	setFieldTable();
	/*@cc_on @*/
	/*@if (@_win32)
	addClass(document.getElementById('page'),'scriptedIe');
	newerThanIe6 = eval('document.getElementsByTagName("body")[0].currentStyle.minWidth');
	if (!newerThanIe6) {
		setLowIeNav();
	}
	fixIe();
	/*@end @*/
}

if (document.addEventListener) {
    document.addEventListener("DOMContentLoaded", init, null);
}
else if (/WebKit/i.test(navigator.userAgent)) {
	var _timer = setInterval(function() {
		if (/loaded|complete/.test(document.readyState)) {
			clearInterval(_timer);
			init();
		}
	}, 10);
}
else {
	/*@cc_on @*/
	/*@if (@_win32)
	document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
	var script = document.getElementById("__ie_onload");
	script.onreadystatechange = function() {
		if (this.readyState == "complete") {
			init();
		}
	};
	/*@end @*/
}
window.onload = init;