 
function doSomething() {



var viewportwidth;
var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
 
var myw=viewportwidth*0.7;

	var vars = { xml_location : 'fileadmin/templates/3dslide/CU3ER-config.php?scalex='+(Math.round((1/(1501/myw))*100)/100) };
				// add Flash embedding parameters, etc. wmode, bgcolor...
				var params = { wmode: 'transparent'  };
				// Flash object attributes id and name
				var attributes = { id:'CU3ER', name:'CU3ER' };
				// dynamic embed of Flash, set the location of expressInstall if needed
				swfobject.embedSWF('fileadmin/templates/3dslide/CU3ER.swf', "CU3ER", myw, myw/2.3, "10.0.0", 
				"js/expressinstall.swf", vars, params, attributes );
				// initialize CU3ER class containing Javascript controls and events for CU3ER
				var CU3ER_object = new CU3ER("CU3ER");  
				
	message('ohne');
	
	
};

var resizeTimer;
$(window).resize(function() {
    clearTimeout(resizeTimer);
    resizeTimer = setTimeout(doSomething, 600);
});



window.onscroll = scroll;
function scroll() {


if(window.pageYOffset==0)

{
$('#right_bottom').css({'display':'none'});
}
else{
$('#right_bottom').css({'display':'block'});
}

}
function scrollWin(){
$('html,body').animate({
scrollTop: 0
}, 2000);
}


var index=0;
var sliding="no";
function animateme(id) {



var theh = $('#'+id).find('img').height();

window.scrollTo(0,$('#'+id).position().top+40);
if(jQuery('#'+id).hasClass('open')) {
$('#'+id).removeClass('open');
$('#'+id).animate({'height':'200px'},1400);

}
else{
$('#'+id).animate({'height':theh+'px'},1400);
$('#'+id).addClass('open');
}

}

function animatemeout(id) {



//$('#'+id).animate({'height':'200px'},1400);


}


		
var newwin;
function popup(url,name,eigenschaften)
    {
    newwin = window.open(url,name,eigenschaften);
    if(version > 1.0)
        {
        setTimeout('newwin.focus();',200);
        }
    }
function start()
{document.getElementById('loading').style.height=document.getElementById('imagebg').offsetHeight +2;}




var viewportwidth;
var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
 

$('#rechts_c').css('left',(viewportwidth/100)*68+'px');
$('#all').css('paddingLeft',$('#left').width()-20+'px');
$('#all').css('width',(viewportwidth/100)*81+'px');

$("#imageholder").css('height',viewportwidth/2.921739130434783+'px');
$("#cuberholder").css('height',viewportwidth/2.921739130434783+'px')
$('#jsfallback').css({height:$("#imagebg").height,width:$("#imagebg").width()});

oldheight=$("#imageholder").height();
oldheightholder=$("#mcholder").height();
oldmainwidth=$("#maincontent").width();

 $(document).ready(function() {
 
 $("#imagebg").attr("src","http://www.nvii-media.com/fileadmin/templates/field.jpg");
 
 $('#right_bottom').css({'display':'none'});

var viewportwidth;
 var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
 


				
				
 document.getElementById('loading').style.visibility='hidden';
 document.getElementById('rechtscontent').style.width=viewportwidth*85/100+'px';
 
$("#slidebutton").bind('click',function(){
if($('#rechts_c').hasClass('open')){

$('#rechts_c').animate({'left':oldleft+'px'},1200);
$('#rechts_c').removeClass('open');
}

else{
oldleft=$('#rechts_c').position().left;
$('#rechts_c').animate({'left':$('#left').width()-166+'px'},1200);
$('#rechts_c').addClass('open');
}
});



$("#slidebutton").bind('mouseover',function(){
$("#slidebutton").find('img').attr("src","fileadmin/templates/newdesign/button_over.png");
});


$("#slidebutton").bind('mouseout',function(){
$("#slidebutton").find('img').attr("src","fileadmin/templates/newdesign/button.png");
});

if(viewportwidth>1280 && viewportheight>780)
		{
		var v_css  = document.createElement('link');
		v_css.rel = 'stylesheet'
		v_css.type = 'text/css';
		v_css.href = 'fileadmin/templates/big.css';
		document.getElementsByTagName('head')[0].appendChild(v_css);
		}
if(viewportwidth>1540)
	{
	$("a[title='das Unternehmen']").html('nvii-media | das Unternehmen');
	}
if(viewportwidth<900)
		{
		var v_css  = document.createElement('link');
		v_css.rel = 'stylesheet'
		v_css.type = 'text/css';
		v_css.href = 'fileadmin/templates/handy.css';
		document.getElementsByTagName('head')[0].appendChild(v_css);
		}

 });

$(window).load(function() {

onstart();

});




window.onresize=message('ohne');

function message(blub) {

var viewportwidth;
var viewportheight;
 
 // the more standards compliant browsers (mozilla/netscape/opera/IE7) use window.innerWidth and window.innerHeight
 
 if (typeof window.innerWidth != 'undefined')
 {
      viewportwidth = window.innerWidth,
      viewportheight = window.innerHeight
 }
 
// IE6 in standards compliant mode (i.e. with a valid doctype as the first line in the document)

 else if (typeof document.documentElement != 'undefined'
     && typeof document.documentElement.clientWidth !=
     'undefined' && document.documentElement.clientWidth != 0)
 {
       viewportwidth = document.documentElement.clientWidth,
       viewportheight = document.documentElement.clientHeight
 }
 
 // older versions of IE
 
 else
 {
       viewportwidth = document.getElementsByTagName('body')[0].clientWidth,
       viewportheight = document.getElementsByTagName('body')[0].clientHeight
 }
 

 

				

 
if(blub!="ohne"){
 oldheight=viewportwidth/3.41739130434783;
 oldheightholder=oldheight*0.2;
 $("#imageholder").animate({'height':oldheight+'px'}, {duration:200,easing:'easeInSine'});
$("#imageholder").find('img').animate({'marginTop':"0px"}, {duration:200,easing:'easeInSine'});
 document.getElementById('rechtscontent').style.width=viewportwidth*85/100+'px';
//$("#maincontent").animate({'marginTop':'0px'}, {duration:1200,easing:'easeInSine'});}

}
 oldheight=viewportwidth/3.41739130434783;
 oldheightholder=oldheight*0.2;
if(viewportwidth<900)
		{
			$('#rechtscontent').css('left',20+'px');
			$('#rechts_c').css('width',(viewportwidth/100)*20+'px');
			$('#left').css('width',(viewportwidth/100)*20+'px');
			$('#rechts_c').css('border-left','2px solid #ff3300');
			$('#left').css('min-width',200+'px');
			$('#left').css('background','#333333');
			$('#rechts_c').css('left',(viewportwidth/100)*80+'px');
			$('#rechts_c').css('background','#ffffff');
			$('#all').css('paddingLeft',220+'px');
			
			
			
		}else{
				$('#left').css('width',(viewportwidth/100)*16+'px');
				$('#left').css('min-width','220px');
				$('#rechtscontent').css('left',190+'px');
				$('#rechtscontent').css('width',viewportwidth*85/100+'px');
				$('#rechts_c').css('width',(viewportwidth/100)*32+'px');
				$('#rechts_c').css('left',(viewportwidth/100)*68+'px');
				$('#rechts_c').css({'border':'0px','background':'transparent','background-image': 'url(http://www.nvii-media.com/fileadmin/templates/newdesign/blockrechts.png)','background-repeat':'no-repeat','background-position':'center left'});
				$('#left').css({'border':'0px','background':'transparent','background-image': 'url(http://www.nvii-media.com/fileadmin/templates/newdesign/blocklinks.png)','background-repeat':'no-repeat','background-position':'center right'});
				$('#all').css('paddingLeft',$('#left').width()-20+'px');
				$('#all').css('width',(viewportwidth/100)*81+'px');

				oldleft=$('#rechts_c').position().left;

				$("#imageholder").css('height',$("#imageholder").height());
				
			
              }
	if(index!=1)
	{
	slideddown=true;

	}
	
	

if(slideddown==true){


$("#cuberholder").animate({'height':oldheight+'px'}, {duration:1200,easing:'easeInSine'});
//$("#imagebg").animate({'height':oldheight+'px'}, {duration:1200,easing:'easeInSine'});
$("#imageholder").find('img').animate({'marginTop':"0px"}, {duration:10,easing:'easeInSine'});
$("#cuberholder").animate({'top':"0px"}, {duration:10,easing:'easeInSine'});
$("#imageholder").animate({'height':oldheight+'px'}, {duration:1200,easing:'easeInSine'});
}

}








function onstart()
{

var myw=viewportwidth*0.7;

	var vars = { xml_location : 'fileadmin/templates/3dslide/CU3ER-config.php?scalex='+(Math.round((1/(1501/myw))*100)/100) };
				// add Flash embedding parameters, etc. wmode, bgcolor...
				var params = { wmode: 'transparent'  };
				// Flash object attributes id and name
				var attributes = { id:'CU3ER', name:'CU3ER' };
				// dynamic embed of Flash, set the location of expressInstall if needed
				swfobject.embedSWF('fileadmin/templates/3dslide/CU3ER.swf', "CU3ER", myw, myw/2.3, "10.0.0", 
				"js/expressinstall.swf", vars, params, attributes );
				// initialize CU3ER class containing Javascript controls and events for CU3ER
				var CU3ER_object = new CU3ER("CU3ER");  
// als func mit timeout aufrufen...
setTimeout("show3d()",3000); 
document.getElementById('loading').style.visibility='hidden';

	
$("#img1").attr("src","http://www.nvii-media.com/newimg/1.jpg");

$("#img2").attr("src","http://www.nvii-media.com/newimg/2.jpg");

$("#img3").attr("src","http://www.nvii-media.com/newimg/3.jpg");

$("#img4").attr("src","http://www.nvii-media.com/newimg/4.jpg");

$("#img5").attr("src","http://www.nvii-media.com/newimg/6.jpg");

$("#img6").attr("src","http://www.nvii-media.com/newimg/7.jpg");

$("#img7").attr("src","http://www.nvii-media.com/newimg/8.jpg");

$("#img8").attr("src","http://www.nvii-media.com/newimg/9.jpg");

$("#img0").attr("src","http://www.nvii-media.com/newimg/0.jpg");

$("#img0").css("width","110%");$("#img0").css("height","auto");
$("#img1").css("width","110%");$("#img1").css("height","auto");
$("#img2").css("width","110%");$("#img2").css("height","auto");
$("#img3").css("width","110%");$("#img3").css("height","auto");
$("#img4").css("width","110%");$("#img4").css("height","auto");
$("#img5").css("width","110%");$("#img5").css("height","auto");
$("#img6").css("width","110%");$("#img6").css("height","auto");
$("#img7").css("width","110%");$("#img7").css("height","auto");
$("#img8").css("width","110%");$("#img8").css("height","auto");

document.getElementById('flaobj2').innerHTML=' <object        classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"        id="ref_big2"        width="500" height="780"     >        <param name="movie" value="fileadmin/templates/kontakt.swf">  <param name="salign" value="top">      <param name="bgcolor" value="#FFFFFF">        <param name="quality" value="high">		<param name="wmode" value="transparent"        <param name="allowscriptaccess" value="samedomain">        <embed          type="application/x-shockwave-flash"          pluginspage="http://www.macromedia.com/go/getflashplayer"      name="ref_big"          width="590" height="680" src="fileadmin/templates/kontakt2.swf"          bgcolor="#FFFFFF"		  wmode="transparent"          quality="high"          swliveconnect="true"          allowscriptaccess="samedomain"    >              </embed>      </object>';



$('#imageholder').betterTooltip({speed: 100, delay: 100});
$("a[rel^='prettyPhoto']").prettyPhoto();


viewportheight=$("#maincontent").position().top;
oldheight=$("#imageholder").height()+20;
oldheightholder=$("#mcholder").height();
oldmainwidth=$("#maincontent").width();
if(index==1){
document.getElementById('imageholder').style.height=oldheight+'px';
document.getElementById('imageholder').style.overflow='hidden';
$("#imageholder").animate({'height':'290px'}, {duration:1200,easing:'easeInSine'});
$("#imageholder").find('img').animate({'marginTop':-oldheight+290+"px"}, {duration:1200,easing:'easeInSine'});
$("#cuberholder").animate({'top':-oldheight+290+"px"}, {duration:1200,easing:'easeInSine'});


$("#imageholder").bind('mouseenter',function(){
slideddown=true;
$("#imageholder").animate({'height':oldheight+'px'}, {duration:1200,easing:'easeInSine'});
$("#imageholder").find('img').animate({'marginTop':"0px"}, {duration:1200,easing:'easeInSine'});
$("#cuberholder").animate({'top':"0px"}, {duration:1200,easing:'easeInSine'});

if(index==1){} else{
$("#mcholder").animate({'height':oldheightholder+'px'}, {duration:1200,easing:'easeInSine'});
$("#maincontent").animate({'marginTop':'0px'}, {duration:1200,easing:'easeInSine'});}

}).bind('mouseleave',function(){




});
}

/*
 $("#cuberholder").css('height',viewportwidth/2.921739130434783+'px');
 $("#cuberholder").css('top',-viewportwidth/2.921739130434783+'px');
*/


if(index==1){
} else{
document.getElementById('mcholder').style.overflow='hidden';
//$("#mcholder").animate({'height':'90px'}, {duration:1200,easing:'easeInSine'});
if($("#maincontent").width()<800){
$("#maincontent").animate({'width':'800px'},0);
}

//$("#maincontent").animate({'marginTop': viewportheight/2-80+'px'}, {duration:1200,easing:'easeInSine'});
oldheight=$("#imageholder").height();
oldheightholder=$("#mcholder").height();
oldmainwidth=$("#maincontent").width();
}




start();message('ohne');


document.getElementById('flaobj2').innerHTML=' <object        classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"        codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,79,0"        id="ref_big2"        width="500" height="780"     >        <param name="movie" value="fileadmin/templates/kontakt.swf">  <param name="salign" value="top">      <param name="bgcolor" value="#FFFFFF">        <param name="quality" value="high">		<param name="wmode" value="transparent"        <param name="allowscriptaccess" value="samedomain">        <embed          type="application/x-shockwave-flash"          pluginspage="http://www.macromedia.com/go/getflashplayer"      name="ref_big"          width="590" height="680" src="fileadmin/templates/kontakt2.swf"          bgcolor="#FFFFFF"		  wmode="transparent"          quality="high"          swliveconnect="true"          allowscriptaccess="samedomain"    >              </embed>      </object>';
document.getElementById('images').style.height=document.getElementById('all').offsetHeight+"px" ;


}



function show3d()

{
$("#imagebg").animate({'opacity':0}, {duration:2000});
}


      
      


