function profilePopUp(theID){
	LoadProfile("http://www.baunetz.de/sixcms_4/sixcms/detail.php?object_id=18&area_id=2504&id=" + theID, 'ain', 'status=yes,scrollbars=yes', 837, 510, true);
}

function LoadProfile(theURL, winName, features, myWidth, myHeight, isCenter) { //v3.0
  if(window.screen && isCenter){
    var myLeft = (screen.width-myWidth)/2;
    var myTop = (screen.height-myHeight)/2;
    features += (features!='')?',':'';
    features += ',left='+myLeft+',top='+myTop;
  }

  archpopup = window.open(theURL, winName, features+((features!='')?',':'')+'width='+myWidth+',height='+myHeight);

  if(archpopup){
  	top.archpopup.focus();
  	this.blur();
  }
}

function replaceLines(){
	var hrs = document.getElementsByTagName('hr');
	if(hrs && hrs.length > 0){
		var hrDiv;
		for(i=0;i<hrs.length;i++){
			hrDiv = document.createElement('div');
			hrDiv.id = 'hr_' + i;
			hrDiv.className = 'hr';
			hrs[i].parentNode.insertBefore(hrDiv, hrs[i]);
			hrs[i].style.display = 'none'; 
		}
	}
}

function showSelect(idx){
	var old = document.getElementsByClassName("current", $("ranking-form"))[0] || $("ranking-form-sub-0");
	console.log(old);
	var obj = $('ranking-form-sub-' + idx);
	console.log(obj);
	if(obj){
		if(old){
			Element.hide(old);
			Element.removeClassName(old, "current");
			old.removeAttribute('name');
		}
		Element.show(obj);
		Element.addClassName(obj, "current");
		old.setAttribute('name', "sub");
	}
}

var _old_onload = window.onload;

window.onload = function(){
	if(typeof _old_onload == "function") _old_onload();
	
	if(typeof myswap == "function") myswap('1ranking');
	replaceLines();
}