function rateMe(id,track_id) {
	var element = document.getElementById(id);
    var hidden_element = document.getElementById('hidden_'+id);
    if(element.hasChildNodes()) {
	   	var delete_element = element.getElementsByTagName('span');
		var ele = delete_element[0];
		if(ele) {
			ele.style.width = '0';
		    element.onmousemove = function (e) {
		    	obj = element;
		        this.absXPos = obj.offsetLeft;
		        while (obj.offsetParent) {
		        	obj = obj.offsetParent;
		            this.absXPos += obj.offsetLeft;
		        }
		        var e = e || window.event;
		        var relPos = e.clientX || e.pageX;
		        ele.style.width = Math.round((relPos - this.absXPos)/9)*9 + 'px';
		    }
			
		    element.onmouseover = element.onmousemove;
		   	element.onmouseout = function () {
		    	ele.style.width = '0';
		    }	
		    element.onclick = function () {
		        hidden_element.value = Math.round(ele.offsetWidth*162/this.offsetWidth);
		        if(hidden_element.value > 162)hidden_element.value = 162;
				//hidden_element.value = (parseInt(hidden_element.value/9)*.5).toString().replace(/\./,',');
		
			    this.onmouseout = function () {
		    	    ele.style.width = hidden_element.value + 'px';
		        };
		
		             //var star = (this.myHiddenInput.value == 18 ) ? ' Stern' : ' Sterne';
		//             alert((parseInt(this.myHiddenInput.value/9)*.5).toString().replace(/\./,',') + star);
		//			var myValue = this.myHiddenInput.value;
		//			 var ele = document.getElementById('wurst'+i);
		//			 ele.value = this.offsetWidth + ' - ' + myValue + ' - '+ (parseInt(this.myHiddenInput.value/9)*.5).toString().replace(/\./,',') + star;  
		         return;
			}
			return false;
		}
//		alert(delete_element);
//		delete_element.style.width = '0';
 //   	alert(delete_element);
	}
    element.myActualRating 		= document.createElement('SPAN');
    element.appendChild(element.myActualRating);
    element.onmousemove = function (e) {
    	obj = element;
        this.absXPos = obj.offsetLeft;
        while (obj.offsetParent) {
        	obj = obj.offsetParent;
            this.absXPos += obj.offsetLeft;
        }
        var e = e || window.event;
        var relPos = e.clientX || e.pageX;
        this.myActualRating.style.width = Math.round((relPos - this.absXPos)/9)*9 + 'px';
    }
	
    element.onmouseover = element.onmousemove;
   	element.onmouseout = function () {
    	this.myActualRating.style.width = '0';
    }	
    element.onclick = function () {
        hidden_element.value = Math.round(this.myActualRating.offsetWidth*162/this.offsetWidth);
        if(hidden_element.value > 162)hidden_element.value = 162;
		//hidden_element.value = (parseInt(hidden_element.value/9)*.5).toString().replace(/\./,',');

	    this.onmouseout = function () {
    	    this.myActualRating.style.width = hidden_element.value + 'px';
        };

             //var star = (this.myHiddenInput.value == 18 ) ? ' Stern' : ' Sterne';
//             alert((parseInt(this.myHiddenInput.value/9)*.5).toString().replace(/\./,',') + star);
//			var myValue = this.myHiddenInput.value;
//			 var ele = document.getElementById('wurst'+i);
//			 ele.value = this.offsetWidth + ' - ' + myValue + ' - '+ (parseInt(this.myHiddenInput.value/9)*.5).toString().replace(/\./,',') + star;  
         return;
	}
}

function rateMeExists(element,hidden_element,ele) {
    element.onmousemove = function (e) {
    	obj = element;
        this.absXPos = obj.offsetLeft;
        while (obj.offsetParent) {
        	obj = obj.offsetParent;
            this.absXPos += obj.offsetLeft;
        }
        var e = e || window.event;
        var relPos = e.clientX || e.pageX;
        this.myActualRating.style.width = Math.round((relPos - this.absXPos)/9)*9 + 'px';
    }
	
    element.onmouseover = element.onmousemove;
   	element.onmouseout = function () {
    	this.myActualRating.style.width = '0';
    }	
    element.onclick = function () {
        hidden_element.value = Math.round(this.myActualRating.offsetWidth*162/this.offsetWidth);
        if(hidden_element.value > 162)hidden_element.value = 162;
		//hidden_element.value = (parseInt(hidden_element.value/9)*.5).toString().replace(/\./,',');

	    this.onmouseout = function () {
    	    this.myActualRating.style.width = hidden_element.value + 'px';
        };

             //var star = (this.myHiddenInput.value == 18 ) ? ' Stern' : ' Sterne';
//             alert((parseInt(this.myHiddenInput.value/9)*.5).toString().replace(/\./,',') + star);
//			var myValue = this.myHiddenInput.value;
//			 var ele = document.getElementById('wurst'+i);
//			 ele.value = this.offsetWidth + ' - ' + myValue + ' - '+ (parseInt(this.myHiddenInput.value/9)*.5).toString().replace(/\./,',') + star;  
         return;
	}
}

function showDebugger(value) {
	var a = new Date();
	a = new Date(a.getTime() +1000*60*60*24*365);

	if(value == 0) {
		document.cookie = 'debugging=0;'; 
	} else {
		document.cookie = 'debugging=1; expires='+a.toGMTString()+';'; 
	}
}


function updateBild(id) {
	bild = document.getElementById(id);
	sel = document.getElementById('auswahl');
	selindex = sel.selectedIndex;
	if(selindex=='') {
		vbild = '/img/cover/big/default.png';
	} else {
		vbild = "/img/cover/big/" + sel.options[selindex].value + '.png';
	}
	bild.setAttribute('src',vbild);
}

function makeAction()  {
	jahr 	= document.getElementById('jahr').value;
	monat 	= document.getElementById('monat').value;
	tag		= document.getElementById('tag').value;
	string	= jahr +"_"+monat+"_"+tag;
	top.location.href = "/de/basics/"+ string +"/2006/heute/menue_default/uebersicht.html";
}
function jumper(){
	location=document.jump.wettbewerb_id.options[document.jump.wettbewerb_id.selectedIndex].value;
}
function showthreads(id) {
	ele = document.getElementById(id);
	if(ele.style.display == "none") {
		ele.style.display = "block";
		return;
	} else {
		ele.style.display = "none";
	}
}

function clone() {
    this.index=0;
    this.cloneTR=function()  {   
        this.index++;
        var incrementor = document.getElementById(this.table.id).getElementsByTagName('tr').length - 2;
        
        this.objClone = this.table.rows[this.table.rows.length-1].cloneNode(true);
        this.childs=this.objClone.getElementsByTagName("*");

        for(i=0; i<this.childs.length; i++) {
			if(this.index%2==0) {
				if(this.childs[i].parentNode.tagName=='TR') {
					this.childs[i].parentNode.removeAttribute('class');
					this.childs[i].parentNode.setAttribute('class','bghell');
				}
	//			this.childs.parentNode.dAttribute('class="bghell"');
			}			
			if(i==0) {
				this.childs[i].innerHTML = incrementor;
			}
	        if(this.childs[i].tagName.match(/textarea|input|select/i)) {
	            if(this.childs[i].tagName=='INPUT' && this.childs[i].type=='text') {
	                this.childs[i].removeAttribute('value');
                }
                this.childs[i].name=String(this.childs[i].name).replace(/\[\d*\]$/,'['+incrementor+']');
            }
        }
        this.table.getElementsByTagName("tbody")[0].appendChild(this.objClone)
  	}
}

function init_cloning(obj,what) {
    switch(what) {
	    case 'TR':
	        var parent=obj;
            var ele=document.getElementById(obj);
            while((parent.tagName!='table' || parent.id=='undefined') && parent.parentNode) {
	            parent=parent.parentNode;
                if(parent.tagName=='TABLE' && parent.id!='undefined') {
	                eval(parent.id+'_clone=new clone()');
                    eval(parent.id+'_clone.table=parent');
                    obj.onclick=new Function('',parent.id+'_clone.clone'+what+'()');
                    eval(parent.id+'_clone.clone'+what+'()');
                    return;
                }
             }
   	}
}

