



piclist = Array('/img2/head_m_l_default.jpg','/img2/head_w_r_default.jpg','/img2/head_m_l_kfz.jpg','/img2/head_w_l_gips.jpg','/img2/head_m_r_zim.jpg','/img2/head_w_l_fris.jpg');

document.write("<link id=\"sizefix\" rel=\"stylesheet\" href=\"/sizefix.css\" media=\"screen\" />");
document.write("<style type=\"text/css\">.nav2,.nav3,.nav4,#includenav {display:none;} </style>");


/* umfrage090713 start
showumfrage090713 = (document.title=='Handwerkskammer Region Stuttgart - Handwerkskammer Region Stuttgart') && (document.cookie.indexOf('umfrage090713shown')==-1);
if (self.location.href.indexOf('umfrage090713=1')!=-1 || showumfrage090713) {
 var ablauf = new Date();
 var einJahr = ablauf.getTime() + (360 * 24 * 60 * 60 * 1000);
 ablauf.setTime(einJahr);
 document.cookie = 'umfrage090713shown=1; expires='+ ablauf.toGMTString();
 document.write('<scr'+'ipt src="umfrage.php" type="text/javascript"></scr'+'ipt>');
}
umfrage090713 ende */


function recom() {
 r=window.open("/recom.php?refurl="+self.location.href,"r","width=420,height=330,scrollbars=no");
 r.focus();
}
function checkresize() {
 hideMenu();
 if (document.body && document.body.offsetWidth > 1) { docwidth = document.body.offsetWidth; } else { docwidth = self.innerWidth;}
 document.getElementById('sizefix').disabled = (docwidth > 1014) ? false : true;
}
function getdatede() {
Wn=Array("Sonntag","Montag","Dienstag","Mittwoch","Donnerstag","Freitag","Samstag");
Mn=Array("Januar","Februar","März","April","Mai","Juni","Juli","August","September","Oktober","November","Dezember");
D=new Date(); Y = D.getYear(); if (Y < 200 && Y > 20) Y += 1900; 
return Wn[(D.getDay())] + ", " + D.getDate() + ". " + Mn[(D.getMonth())] + " " + Y;
}
function getTop(obj) {
t = obj.offsetTop;
while(obj.offsetParent!=null) {
objParent = obj.offsetParent;
t += objParent.offsetTop;
obj = objParent;
}
return t;
}
var lastmnu=0;
Aobjs = Array();
function handleMenu(e) {
if (!e) var e = window.event;
if (e.target) { A = e.target; } else if (e.srcElement) { A = e.srcElement; }
if (A.style.position=="absolute") return;
hideMenu();
if (A.id.substring(0,4)=="hide") { return; }
Anum = A.id.substring(4,A.id.length);
menuY = getTop(A) + 8;
menuX = A.offsetWidth;
menuW = A.offsetWidth;
nextTop = menuY;
lastClass="";
moverLevel=parseInt(A.className.substr(3,1)); // Navilevel des MouseOverObjektes
obj = document.getElementById('navi');
for (i=Number(Anum)+2; i < obj.childNodes.length; i=i+1) {
  Achild = obj.childNodes[i];
  if (Achild.nodeName.toUpperCase()=="A") {
  if(Achild.className.substr(3,1)<=moverLevel){break;} // gleicher Level wie MouseOverObjekt --> Ende Submenue
  if(parseInt(Achild.className.substr(3,1)) > parseInt(moverLevel+1)){continue;} // Unterpunkte nicht anzeigen
  if (lastClass=="") Achild.style.borderTop = "1px #C8C8C8 solid";
    Achild.style.borderLeft = "1px #C8C8C8 solid";
    Achild.style.position = "absolute";
    Achild.style.left = menuX + "px";
    Achild.style.top = nextTop + "px";
if (moverLevel==1) {
    Achild.style.width = menuW - ((document.all) ? 0 : 13) + "px";
    Achild.style.paddingLeft = "10px";
} else {
    Achild.style.width = menuW - ((document.all) ? 0 : 19) + "px";
    Achild.style.paddingLeft = "16px";
}
    Achild.style.display = "block";
    nextTop = nextTop + Achild.offsetHeight;
    
    Aobjs[Aobjs.length] = i;
    
    lastClass = Achild.className.substring(0,4);
  }
}
}
function hideMenu() {
stopHideTimer();
if (Aobjs.length==0) return;
obj = document.getElementById('navi');
for (i=0; i < Aobjs.length; i=i+1) {
  obj.childNodes[(Aobjs[i])].style.display="none";
}
Aobjs = Array();
}
hideTimer=0;
function startHideTimer() {
hideTimer = window.setTimeout("hideMenu()",1000);
}
function stopHideTimer() {
if (hideTimer) window.clearTimeout(hideTimer);
}
ParentNav1=-1; LastNav1=-1;
ParentNav2=-1; LastNav2=-1;
ParentNav3=-1; LastNav3=-1;
function initMenu() {
//if (self.PLnameid) nameid = PLnameid;
obj = document.getElementById('navi');
if (! obj.childNodes) return;
lastA = "";
for (i=0; i < obj.childNodes.length; i=i+1) {
  A = obj.childNodes[i];
  
  if (A.nodeName.toUpperCase()=="A") {
   Aclass = A.className.substring(0,4);
   Alevel = Aclass.substring(3,4);
   A.onmouseover = handleMenu;
   A.onfocus = handleMenu;
   if (lastA!="" && lastA.id!="hide") {
    lastAlevel = lastA.className.substring(3,4);
    lastA.id = (lastAlevel < Alevel) ? "show"+lastI : "hide";
    if (lastA.id!="hide") {
     lastA.mouseover=stopHideTimer;
     lastA.mouseout=startHideTimer;
     lastA.className += " sub";
    }
   }
   if (nameid!="") {
    if (Aclass=="nav1") LastNav1 = i;
    else if (Aclass=="nav2") LastNav2 = i;
 else if (Aclass=="nav3") LastNav3 = i;
 if (A.name==nameid && showPageLinks=='') {
 A.className += " nav"+A.className.substring(3,4)+"active";
 A.id="hide";
  if (LastNav1 > -1 && Alevel > 1) { obj.childNodes[LastNav1].id="hide"; obj.childNodes[LastNav1].className += " nav"+obj.childNodes[LastNav1].className.substring(3,4)+"active";}
  if (LastNav2 > -1 && Alevel > 2) { obj.childNodes[LastNav2].id="hide"; obj.childNodes[LastNav2].className += " nav"+obj.childNodes[LastNav2].className.substring(3,4)+"active";}
  if (LastNav3 > -1 && Alevel > 3) { obj.childNodes[LastNav3].id="hide"; obj.childNodes[LastNav3].className += " nav"+obj.childNodes[LastNav3].className.substring(3,4)+"active";}
  nav2sub = false;
  nav3sub = false;
  for (j=LastNav1; j < obj.childNodes.length; j=j+1) {
  actA = obj.childNodes[j];
  if (actA.nodeName.toUpperCase()!="A") continue;
  actAlevel = Number(actA.className.substring(3,4));
  if (actAlevel==2 && LastNav2==j) nav2sub = true;
  else if (actAlevel==2) nav2sub = false;
  if (actAlevel==3 && LastNav3==j && Alevel > 2) nav3sub = true;
  else if (actAlevel==3) nav3sub = false;
  if (actAlevel==1 && LastNav1!=j) break;
  //alert(actAlevel + " " + Alevel);
  if (actAlevel==2 || (actAlevel==3 && nav2sub) || (actAlevel==4 && nav3sub)) actA.style.display="block";
  
  }


 }
 }
    lastA = A;
    lastI = i;
  }
}
lastA.id = "hide";
/*if (nameid!="" && LastNav1 > -1) {
 for (i=ParentNav1; i < obj.childNodes.length; i=i+1) {
   A = obj.childNodes[i];
   if (A.nodeName.toUpperCase()=="A") {
   Aclass = A.className.substring(0,4);
   if (ParentNav1==i) { A.id="hide"; } else { if (Aclass=="nav1") break; }
   if (Aclass=="nav2") A.style.display="block";
   
   if (Aclass=="nav2" && ParentNav2==i) { isvisible=true; A.id="hide"; }
   else if (Aclass=="nav2") { isvisible=false; }
   if (Aclass=="nav3" && isvisible) {A.style.display="block";}
   }
 }
}*/
}
function findA(Aname) {
obj = document.getElementById('navi');
if (! obj.childNodes) return;
for (i=0; i < obj.childNodes.length; i=i+1) {
if (obj.childNodes[i].nodeName.toUpperCase()=="A" && obj.childNodes[i].name==nameid) return obj.childNodes[i];
}
}
function init() {

/* Track Downloads */
i=0;
while (this_a = document.getElementsByTagName('a')[i++]) {
 if (this_a.className.indexOf('downlink')==-1) continue;
 this_a.onmousedown = function(){ET_Event.download(this.href, 'Download');};
}
/* End Track Downloads */

/* Track Search */
if (self.location.href.indexOf('/suche.html?q=')!=-1) {
 var suchbegriff = self.location.href.split('/suche.html?q=')[1].split('&')[0];
 if (suchbegriff) {
  ET_Event.eventStart('Suche', suchbegriff, 'Trefferliste','');
 }
}
/* End Track Search */

/* Track Area */
i=0;
while (sheet = document.styleSheets[i++]) {
 if (sheet.href.indexOf('rot.css')!=-1) {
  hwk_area='Aktuell';
  break;
 } else if (sheet.href.indexOf('orange.css')!=-1) {
  hwk_area='Ausbildung';
  break;
 } else if (sheet.href.indexOf('blau.css')!=-1) { /*gruen*/
  hwk_area='Weiterbildung';
  break;
 } else if (sheet.href.indexOf('gruen.css')!=-1) { /*blau*/
  hwk_area='Beratung';
  break;
 } else if (sheet.href.indexOf('lila.css')!=-1) {
  hwk_area='Handwerk';
  break;
 }
}
/* End Track Area */

window.onresize = checkresize;
if (! document.getElementById('navi')) return;
document.getElementById('navi').onmouseover = stopHideTimer;
document.getElementById('navi').onmouseout = startHideTimer;
document.getElementById('searchbox').onfocus = hideMenu;
document.getElementById('searchform').onmouseover = hideMenu;
objA = findA(nameid);
incobj = document.getElementById('includenav');
if (self.incobj && incobj.childNodes  && self.showPageLinks!='') {
for (i=incobj.childNodes.length-1; i >= 0; i=i-1) document.getElementById('navi').insertBefore(incobj.childNodes[i].cloneNode(true), objA.nextSibling);
} else {
 showPageLinks='';
}
// Headbilder //
llist = Array(); rlist = Array();
if (Math.random() > 0.5) { picl = "m_l_"; picr = "w_r_";
} else { picl = "w_l_"; picr = "m_r_"; }
for (i=0; i < piclist.length; i++) {if (piclist[i].indexOf(picl) > -1) llist[llist.length] = piclist[i];if (piclist[i].indexOf(picr) > -1) rlist[rlist.length] = piclist[i];}
document.getElementById('headpic1').style.backgroundImage = "url('" + llist[(Math.floor(Math.random() * llist.length))] + "')";
document.getElementById('headpic2').style.backgroundImage = "url('" + rlist[(Math.floor(Math.random() * rlist.length))] + "')";
////////////////
if (document.body.id == "" || document.body.id=='bboerse') initMenu();
}
window.onload = init;

function goDia(objid,dianr) {
ds = document.getElementById(objid);
for (i=0;i < ds.childNodes.length;i++) ds.childNodes[i].style.display = (dianr==i) ? "block" : "none";
ds.nextSibling.innerHTML = '<input '+ ((dianr < ds.childNodes.length-1)? "" : "disabled=\"disabled\"") +' onclick="javascript:goDia(\''+objid+'\','+ (dianr+1) +');" class="button" type="button" value="weiter" style="float:right;"> <input '+ ((dianr >0)? "" : "disabled=\"disabled\"") +' onclick="javascript:goDia(\''+objid+'\','+ (dianr-1) +');" class="button" type="button" value="zurück" style="float:right;margin-right:10px;"> Bild '+(dianr+1)+'/'+ ds.childNodes.length +', '+ds.childNodes[dianr].alt + '<br style="clear:both;" />';
}



formerr = false;
function checkField(obj) {
 if (obj.className.indexOf("req") > -1 && ((obj.type=="text" && obj.value=="") || (obj.type=="checkbox" && ! obj.checked))) {
 formerr=true;
 if (obj.type=="text") { obj.previousSibling.className+=" err"; } else { obj.nextSibling.className+=" err"; }
 } else if (obj.className.indexOf("req") > -1) {
  if (obj.type=="text") { obj.previousSibling.className=""; } else { obj.nextSibling.className=""; }
 }
}
function checkForm() {
formerr=false;
for (i=0; i < document.getElementsByTagName("input").length; i++) checkField(document.getElementsByTagName("input")[i]);
for (i=0; i < document.getElementsByTagName("textarea").length; i++) checkField(document.getElementsByTagName("textarea")[i]);
document.getElementById("errmsg").style.color = (formerr) ? "red" : "#333";
return (! formerr);
}

