function popup(url,w,h,scrolling){
		
	print_options = true;	
	
	if (!w || !h){ 
		print_options = false;
	}
	
	if (!scrolling){ 
		scrolling='yes'
	}
	
	var generatornum=Math.random();
	var maxnumber=10000;
	var randomnum=Math.round(generatornum*maxnumber);
	var name="popup_" + randomnum;
	
	var win=null;
	LeftPosition=(screen.width)?(screen.width-w)/2:10;
	TopPosition=(screen.height)?(screen.height-h)/2:10;
	ns4=(document.layers)? true:false;
	if (print_options) options='width='+w+',height='+h+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scrolling+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+scrolling;
	else options = '';
	if (ns4){
		if (print_options) options='width='+w+',height='+h+',screenY='+TopPosition+',screenX='+LeftPosition+',scrollbars='+scrolling+',location=no,directories=no,status=no,menubar=no,toolbar=no,resizable='+scrolling;
		else options = '';
	}
	win=window.open(url,name,options);
	
	win.focus();
}

function vergleich_category() {
	var myindex=document.form_category.rubrik.selectedIndex
	location.href=(document.form_category.rubrik.options[myindex].value);
}

function vergleich_model(position) {
	if (position == 2)
	{
		var myindex=document.form_model2.bike2_id.selectedIndex
		location.href=(document.form_model2.bike2_id.options[myindex].value);
	}
	else if (position == 3)
	{
		var myindex=document.form_model3.bike3_id.selectedIndex
		location.href=(document.form_model3.bike3_id.options[myindex].value);
	}
	else
	{
		var myindex=document.form_model1.bike1_id.selectedIndex
		location.href=(document.form_model1.bike1_id.options[myindex].value);
	}
}

function zoom_popup(file){
	url = '../flash/zoom_view.php?rad='+file;
	w = 2504/2.445;
	h = 1304/2.445;
	popup(url,w,h,'yes');
}

function getPage(formname,elementname) {
	
	if(!formname)
	{
		formname = 'form_getpage';
	}
	if (!elementname)
	{
		elementname = 'page';
	}
	var myindex=document.forms[formname].elements[elementname].selectedIndex
	if (document.forms[formname].elements[elementname].options[myindex].value != '')
	{
		location.href=(document.forms[formname].elements[elementname].options[myindex].value);
	}
}

function galerie_popup(dir,file,format) {
	url = dir + '/galerie_popup.html?f=' + file;
	if (format == 'hoch')
	{
		w = '436';
		h = '726';
	}
	else
	{
		w = '656';
		h = '506';
	}
	popup(url,w,h,'no');
}

function wk_help(index,element_focused)
{
	document.getElementById('helpbox_pps['+index+']').style.display = 'none';
	document.getElementById('helpbox_pps_schritt['+index+']').style.display = 'none';
	document.getElementById('helpbox_pps_torso['+index+']').style.display = 'none';
	document.getElementById('helpbox_pps_schulter['+index+']').style.display = 'none';
	document.getElementById('helpbox_pps_arm['+index+']').style.display = 'none';
	document.getElementById('helpbox_schritt['+index+']').style.display = 'none';
	
	document.getElementById(element_focused).style.display = 'block';
}

sfHover = function() {
	var sfEls = document.getElementById("meta").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);