window.onload=function(){
	var width = $('meta').offsetWidth;
	$('meta').style.width=width+'px';
	if(document.all){
		var sFloat="styleFloat";
	}
	else{
		var sFloat="cssFloat";
	}
	$('meta').style[sFloat]="none";
	
	
	if($('faq')){
		var accordion = new Accordion('p.atStart', 'div.atStart', {
			opacity: false,
			onActive: function(toggler, element){
				//toggler.setStyle('color', '#3179A8');
			},
			onBackground: function(toggler, element){
				//toggler.setStyle('color', '#003251');
			},
			start : 'all-closed',
			alwaysHide: true
		},$('acc'));
	}
	
	if($('locations')){
		var accordion = new Accordion('h3.atStart', 'div.atStart', {
			opacity: false,
			onActive: function(toggler, element){
				//toggler.setStyle('color', '#3179A8');
			},
			onBackground: function(toggler, element){
				//toggler.setStyle('color', '#003251');
			},
			start : 'all-closed',
			alwaysHide: true
		},$('acc'));
	}
	
	var navi = $$('#navigation ol li');
	$each(navi,function(item){
		if(item.innerHTML == '<a href="en/shop.html" title="Shop">Shop</a>'){
			//item.setStyle('display','none');
			
		}
		if(item.innerHTML == '<a href="en/shop.html" title="Shop" class="active">Shop</a>'){
			if($$('#shopnavi')[0]){
				$$('#shopnavi')[0].setStyle('left',424);
			}
		}
	});
	
//	console.log($$('.csc-loginform')[1]);
}

/*function $(id){
	return document.getElementById(id);
}*/

var lastDiv;
function showKat(uid){
	//console.log(lastDiv);
	if(lastDiv != null){
		$(lastDiv).setStyle('display','none');
	}
	if($('sub_'+uid) && ('sub_'+uid) != lastDiv){
		$('sub_'+uid).setStyle('display','block');
	}
	lastDiv = 'sub_'+uid;
}
/*
function getAddress(){
	var uid = $('selectfirma').value;	
	var jsonRequest = new Request.JSON({url: "https://www.m2beaute.com/externe/neuer-ansprechpartner.html?json=true&uid="+uid, onComplete: function(res){
		console.log(res);
	}}).send();
}*/


function copyInputData(){
	$('rechnung_m2b_name').value = $('m2b_name').value;
	$('rechnung_m2b_vorname').value = $('m2b_vorname').value;
	$('rechnung_m2b_strasse').value = $('m2b_strasse').value;
	$('rechnung_m2b_strassennummer').value = $('m2b_strassennummer').value;
	$('rechnung_m2b_plz').value = $('m2b_plz').value;
	$('label_ort2').value = $('label_ort').value;	
	$('label_land2').value=$('label_land').value;
}