var el,co;
function divCornerShadow(o,r,u,l,classN,isSide)
{
  div=document.createElement("div");
	if(co.top<390&&o&&(el.className!="dcontentBig"||!r))
	{
		b="b";
		b=((el.id=="subnavi2" || el.id=="subnavi")&&r)?"bb":b;
	}
	else b="";
  div.className=classN+b;
	
  if(o||(r&&isSide)) div.style.top=co.top+"px";
  if(r) div.style.left=co.right-el.style.paddingRight+"px";
  if(u) div.style.top=co.bottom-el.style.paddingBottom+"px";
  if(l||(u&&isSide)) div.style.left=co.left+"px";
  if((o||u)&&isSide) div.style.width=co.width+"px";
  if((r||l)&&isSide) div.style.height=co.height+"px";
  ddd=$("shadows").appendChild(div);
  if(r) ddd.style.left=$(ddd).getCoordinates().left-$(ddd).getCoordinates().width+"px";
  if(u) ddd.style.top=$(ddd).getCoordinates().top-$(ddd).getCoordinates().height+"px";
}

function startShadow()
{
  if(isNoRealReasize) return;
	
	co1=$("contentSection").getCoordinates();
  $("dcontent").style.height=co1.height-60+"px";
  nt=$("drucken");
  nt.style.display="block";
  nt.style.top=$("contentSection").getPosition().y+co1.height-40+"px";
  try{w=$("containerRight").getCoordinates().width}catch(e){w=-15;}
  nt.style.left=$("contentSection").getPosition().x+co1.width-nt.getCoordinates().width-w-40+"px";
  $("shadows").parentNode.removeChild($("shadows"));
  ds=document.createElement("div");
  ds.id="shadows";
  ds.className="shadows";
  $(document.body).appendChild(ds);
  divs=$$("div.dleft","div.dright","#dcontent");
  for(i=0;i<divs.length;i++) 
	{
	if(divs[i].id=="subnavi" && $("subnavi").getElementsByTagName("a").length==0) $("subnavi").style.display="none";
	else shadowRightBottom(divs[i].id);
	}
  co=$("navVerlauf2").getCoordinates();
  $("obenNav").style.left=co.left+"px";
	$("obenNav").style.display="block";
  $("navVerlauf").style.top=co.top+"px";
  $("navVerlauf").style.left=co.left+"px";
	$("navVerlauf").style.display="block";
	
}

function shadowRightBottom(eid)
{
  el=$(eid);
	co=el.getCoordinates();
  
  divCornerShadow(false,false,true,false,"SchattenU",true);
	if(eid=="dcontent")
	{
  	divCornerShadow(true,false,false,true,"SchattenROL",false);
  	divCornerShadow(false,false,true,true,"SchattenRUL",false);
  	divCornerShadow(false,true,true,false,"SchattenEUR",false);
  	divCornerShadow(true,true,false,false,"SchattenEOR",false);
	}
	else
	{
  	divCornerShadow(true,true,false,false,"SchattenROR",false);
    divCornerShadow(false,true,true,false,"SchattenRUR",false);
  	divCornerShadow(false,false,true,true,"SchattenEUL",false);
	}
	divCornerShadow(false,true,false,false,"SchattenR",true);
}

function newElementFont(fs,ar)
{
  el=$$(ar[1]);
	for(i=0;i<el.length;i++);
}

function newFontSize(fs)
{
  nfontSize=parseInt(fs);
	//Array(array(podukt,el(s),startFsize),...)
	myFontElements=[
	new Array(2,"h1",11),
	new Array(1,".dcontent,.dleft,.topNav,.cnavi",8),
	new Array(1,".B_crumbBox,.cright",7)
	];
	myFontElements.each(function(ar){
  	el=$$(ar[1]);
		for(a=0;a<el.length;a++) el[a].style.fontSize=ar[2]+fs*ar[0]+"pt";
	});
	
}


var isNoRealReasize=false;
function printIt()
{
  isNoRealReasize=true;
  blendOut=$$(".containerLeft,.head,.navi,.obenNav,.navVerlauf,.navVerlauf2,.drucken,.containerRight,.shadows");
  blendOut.each(function(e){e.style.display="none";});
  mains=$("main");
	mains.style.margin="0";
	mains.style.width="700px";
  mains.style.padding="0";
	$(document.body).style.backgroundColor="#fff";
  $("dcontent").style.width="auto";
	$("dcontent").style.padding="25px";
	$("dcontent").style.margin="0";
  div=document.createElement("div");
	div.style.borderBottom="1px dotted #10872E"
	div.style.margin="25px 25px 0px 25px";
	div.style.paddingBottom="25px";
	div.innerHTML='<table style="width:700px; margin: 0;"><tr><td style="width:90px;"><img src="assets/templates/logo.jpg" alt=""></td><td><h1 style="font-size: 13pt;">Stadtverwaltung Kitzscher</h1></td></tr></table>';
	mains.insertBefore(div,$("contentSection"));
	$("dcontent").style.padding="25px";
}

function wetter() 
{
/*try
{
tds=document.getElementById("wetter").getElementsByTagName("table")[0].getElementsByTagName("tr")[0].getElementsByTagName("td");
wetterLoad();
document.getElementsByTagName("style")[0].parentNode.removeChild(document.getElementsByTagName("style")[0]);
}
catch(e){;}*/
}
