var timeOuts= new Array();
$(document).ready(function () {
	// Aktionen bei Dokumentstart:
   	$("#btn_plus").click(function() {
	    var size = $(document.body).css("font-size");
		var newSize = parseInt(size.replace(/px/, ""))+2;
		if(newSize <= 20){
	    	$(document.body).css("font-size", newSize + "px");
		}
    });
	$("#btn_minus").click(function() {
	    var size = $(document.body).css("font-size");
		var newSize = parseInt(size.replace(/px/, ""))-2;
		if(newSize >= 10){
	    	$(document.body).css("font-size", newSize + "px");
		}
    });
	$("#btn_null").click(function() {
		var newSize = 13;
	    $(document.body).css("font-size", newSize + "px");
    });
	$("#fsuche").click(function() {
		if(document.getElementById('suche').style.display=='none'){
			$("#suche").fadeIn('fast');
		} else {
			$("#suche").fadeOut('fast');
		}
    });
	$("#bg_showroom1").fadeIn(3000);	
});


function hideNow(id) {
	$('#subnavi_'+id).animate({
	    opacity: 'hide',
	    top: '-15',
	  }, 500, function() {
	    // Animation complete.
	  });
};


function showNav(child){
	document.getElementById('tip'+child).style.display = 'block';
}
function hideNav(child){
	$(document).find('.tooltip').hide();
}

// Reset Timeout with every click:
//document.addEventListener("mousedown",onmousedown,false);


function resetForm(){
	document.getElementById('name').value='';
	document.getElementById('email').value='';
	document.getElementById('betreff').value='';
	document.getElementById('telefon').value='';
	document.getElementById('nachricht').value='';
	
	document.getElementById('name').className='input_text';
	document.getElementById('email').className='input_text';
	document.getElementById('betreff').className='input_text';
	document.getElementById('telefon').className='input_text';
	document.getElementById('nachricht').className='default';
	
	document.getElementById('kopie').checked=0;
	document.getElementById('meldung').style.display='none';
}

function showTeamInfo(member_id){
		//$('#slider .navigation').find('a').click(selectNav);
		$(document).find('.teammember').hide(); // sämtliche Text-Divs ausblenden
		for(i=1;i<=100;i++){
			if(document.getElementById('portrait'+i)){
				document.getElementById('portrait'+i).className='portrait normal';
			}
		}
		document.getElementById('portrait'+member_id).className='portrait active';
		$('#member'+member_id).show();
		$.scrollTo('#member'+member_id,1000);
}

function showStep(id) {
	$('#info_step1').hide();	
	for(i=1;i<=5;i++){
		document.getElementById('step'+i).className='step';	
	}	
	$('#info_step1').className='default';
	$('#info_step2').hide();
	$('#info_step3').hide();
	$('#info_step4').hide();
	$('#info_step5').hide();
	
	//document.getElementById('bg_infobox').style.display='block';
	$('#info_step'+id).show();
	document.getElementById('step'+id).className='step active';
	//$('#infografik').hide();
	
};

function closeInfobox() {
	//document.getElementById('bg_infobox').style.display='none';
	for(i=1;i<=5;i++){
		$('#info_step'+i).hide();
	}
	
	//$('#infografik').fadeIn('fast');
};

function clearAllTimeouts(){
  for(key in timeOuts){
    clearTimeout(timeOuts[key]);
  }
}

function showTab(id) {
	for(i=1;i<=5;i++){
		if($('#content'+i)){
			$('#content'+i).hide();
			$('#tab'+i).removeClass('active');
		}
	}	

	$('#content'+id).fadeIn('slow');
	document.getElementById('tab'+id).className='active';
};


function insertFlash(swf,w,h,alt,flashvars){
	var flashCode="<script type=\"text/javascript\">var hasRightVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); if(hasRightVersion) {";
		flashCode+="AC_FL_RunContent("
		flashCode+="'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=10,0,2,0',"
		flashCode+="'width', '"+w+"',"
		flashCode+="'height', '"+h+"',"
		flashCode+="'src', '"+swf+"',"
		flashCode+="'quality', 'high',"
		flashCode+="'pluginspage', 'http://www.adobe.com/go/getflashplayer',"
		flashCode+="'align', 'middle',"
		flashCode+="'play', 'true',"
		flashCode+="'loop', 'true',"
		flashCode+="'scale', 'showall',"
		flashCode+="'wmode', 'transparent',"
		flashCode+="'devicefont', 'false',"
		flashCode+="'bgcolor', '#ffffff',"
		flashCode+="'menu', 'true',"
		flashCode+="'flashvars', '"+flashvars+"',"
		flashCode+="'allowFullScreen', 'true',"
		flashCode+="'allowScriptAccess','sameDomain',"
		flashCode+="'movie', '"+swf+"',"
		flashCode+="'salign', ''"
		flashCode+="); } else { var alternateContent = '"+alt+"'; document.write(alternateContent); }</script>";
	document.write(flashCode);
}

