
homeOver = new Image();
homeOut = new Image();
homeOver.src = "images/header_m_home_hv.gif";
homeOut.src = "images/header_m_home.gif";

contactOver = new Image();
contactOut = new Image();
contactOver.src = "images/header_m_contact_hv.gif";
contactOut.src = "images/header_m_contact.gif";

loginOver = new Image();
loginOut = new Image();
loginOver.src = "images/header_m_login_hv.gif";
loginOut.src = "images/header_m_login.gif";

faqOver = new Image();
faqOut = new Image();
faqOver.src = "images/header_m_faq_hv.gif";
faqOut.src = "images/header_m_faq.gif";

men0Over = new Image();
men0Out = new Image();
men0Over.src = "images/menu_home_hv.gif";
men0Out.src = "images/menu_home.gif";

men1Over = new Image();
men1Out = new Image();
men1Over.src = "images/menu_about_hv.gif";
men1Out.src = "images/menu_about.gif";

men2Over = new Image();
men2Out = new Image();
men2Over.src = "images/menu_misc_hv.gif";
men2Out.src = "images/menu_misc.gif";

men3Over = new Image();
men3Out = new Image();
men3Over.src = "images/menu_guest_hv.gif";
men3Out.src = "images/menu_guest.gif";

reg0Over = new Image();
reg0Out = new Image();
reg0Over.src = "images/register_00_hv.gif";
reg0Out.src = "images/register_00.gif";

reg1Over = new Image();
reg1Out = new Image();
reg1Over.src = "images/register_01_hv.gif";
reg1Out.src = "images/register_01.gif";

reg2Over = new Image();
reg2Out = new Image();
reg2Over.src = "images/register_02_hv.gif";
reg2Out.src = "images/register_02.gif";

reg3Over = new Image();
reg3Out = new Image();
reg3Over.src = "images/register_03_hv.gif";
reg3Out.src = "images/register_03.gif";

regAOver = new Image();
regAOut = new Image();
regAOver.src = "images/register_A1_hv.gif";
regAOut.src = "images/register_A1.gif";

sessionOver = new Image();
sessionOut = new Image();
sessionOver.src = "images/stock_session_hv.gif";
sessionOut.src = "images/stock_session.gif";

leftOver = new Image();
leftOut = new Image();
leftOver.src = "images/arrow_left_hv.gif";
leftOut.src = "images/arrow_left.gif";

rightOver = new Image();
rightOut = new Image();
rightOver.src = "images/arrow_right_hv.gif";
rightOut.src = "images/arrow_right.gif";



hoverObjects = new Object();
hoverTimers = new Object();
function hover(object, destOp, rate, delta){
if (!document.all)
return
    if (object != "[object]"){
        setTimeout("hover("+object+","+destOp+","+rate+","+delta+")",0);
        return;
    }
    clearTimeout(hoverTimers[object.sourceIndex]);

    diff = destOp-object.filters.alpha.opacity;
    direction = 1;
    if (object.filters.alpha.opacity > destOp){
        direction = -1;
    }
    delta=Math.min(direction*diff,delta);
    object.filters.alpha.opacity+=direction*delta;

    if (object.filters.alpha.opacity != destOp){
        hoverObjects[object.sourceIndex]=object;
        hoverTimers[object.sourceIndex]=setTimeout("hover(hoverObjects["+object.sourceIndex+"],"+destOp+","+rate+","+delta+")",rate);
    }
}





function popup(URL) {
day = new Date();
id = day.getTime();
screenw_gesamt = screen.width;     /* maximale Breite des Bildschirmes */
screenh_gesamt = screen.height;    /* maximale Höhe des Bildschirmes */
movew = (screenw_gesamt - 376) / 2;     /* Berechnung des Horizontalen Fensterabstandes vom Bildschirm */  
moveh = (screenh_gesamt - 600) / 2;     /* Berechnung des Vertikalen Fensterabstandes vom Bildschirm  */  
eval("page" + id + " = window.open(URL, '" + id + "', 'scrollbars=no,resizable=no,width=376,height=600,left="+movew+",top="+moveh+"');");
}






function portfolio_window(imageName,imageWidth,imageHeight,alt,topic,date,comment,link,hugger,hugMargin) {

	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 200;          //  imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 4;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	newWindow.document.open();
	newWindow.document.write('<html><head><title>portfolio</title><META HTTP-EQUIV="imagetoolbar" CONTENT="no"><link href="portfolio/style.css" rel="stylesheet" type="text/css"></head><body scroll="auto">');  
	newWindow.document.write('<table width='+imageWidth+' border="0" cellspacing="0" cellpadding="0">');
	newWindow.document.write('<tr><td height="25px">&nbsp;</td></tr>');
	newWindow.document.write('<tr><td height="24px">'); 
	newWindow.document.write('<table width="100%" height="24px" border="0" cellspacing="2" cellpadding="2">');
	newWindow.document.write('<tr><td width="1" bgcolor="#FB8631"><img src="images/spacer.gif" width="1"></td><td bgcolor="#444444"><span class="portfolio_title">&nbsp;'+alt+'</span></td><td width="20" align="center" valign="bottom" bgcolor="#555555" onclick="javascript: window.close()"><img src="images/popup_cross.gif" width="13" height="13" style="margin-bottom: 3px; margin-left: 1px;"></td></tr>');
	newWindow.document.write('</table>');
	newWindow.document.write('</td></tr>'); 
	newWindow.document.write('<tr><td>');
	newWindow.document.write('<table width="100%" border="0" cellspacing="2" cellpadding="0">');
	newWindow.document.write('<tr><td background="images/bg_loading.gif"><a href="javascript: window.close()"><img src="'+imageName+'" border="0" width='+imageWidth+' height='+imageHeight+' style="border-top: 1px solid #FFFFFF; border-bottom: 1px solid #FFFFFF;" alt="'+alt+'"></a></td></tr>');
	newWindow.document.write('</table>');
	newWindow.document.write('</td></tr>');	
	newWindow.document.write('<tr><td>');
	newWindow.document.write('<table width="100%" border="0" cellspacing="2" cellpadding="2">');
	newWindow.document.write('<tr><td width="1" rowspan="5" bgcolor="#FB8631"><img src="images/spacer.gif" width="1"></td><td width="70" bgcolor="#555555" align="right" nowrap valign="top"><span class="portfolio_data">category <img src="images/absatz_blue.gif" width="4" height="6">&nbsp;</span></td><td bgcolor="#444444"><span class="portfolio_content">&nbsp;'+topic+'</span></td></tr>');
	newWindow.document.write('<tr><td bgcolor="#555555" align="right" nowrap valign="top"><span class="portfolio_data">size <img src="images/absatz_blue.gif" width="4" height="6">&nbsp;</span></td><td bgcolor="#444444"><span class="portfolio_content">&nbsp;'+imageWidth+' x '+imageHeight+' pixel</span></td></tr>');
	newWindow.document.write('<tr><td bgcolor="#555555" align="right" nowrap valign="top"><span class="portfolio_data">date <img src="images/absatz_blue.gif" width="4" height="6">&nbsp;</span></td><td bgcolor="#444444"><span class="portfolio_content">&nbsp;'+date+'</span></td></tr>');
	newWindow.document.write('<tr><td bgcolor="#555555" align="right" nowrap valign="top"><span class="portfolio_data">comment <img src="images/absatz_blue.gif" width="4" height="6">&nbsp;</span></td><td bgcolor="#444444"><span class="portfolio_content">&nbsp;'+comment+'</span></td></tr>');
	newWindow.document.write('<tr><td bgcolor="#555555" align="right" nowrap valign="top"><span class="portfolio_data">link <img src="images/absatz_blue.gif" width="4" height="6">&nbsp;</span></td><td bgcolor="#444444"><span class="portfolio_content">&nbsp;'+link+'</span></td></tr>');	
	newWindow.document.write('</table>');
	newWindow.document.write('</td></tr>');
	newWindow.document.write('<tr><td height="25px" align="right" valign="bottom"><span class="portfolio_copy">&copy; copyright by diwiesign&#8482; studio <img src="images/block_blue.gif" width="2" height="8"><img src="images/block_blue.gif" width="2" height="8" style="margin-left: 1px;"><img src="images/block_blue.gif" width="2" height="8" style="margin-left: 1px;">&nbsp;&nbsp;</span></td></tr>');	
	newWindow.document.write('</table></body></html>');
	newWindow.document.close();
	newWindow.focus();
	}
}





function portfolio_web(image,imageWidth,imageHeight,hugger,hugMargin) {

	var adj=10
	var w = screen.width;
	var h = screen.height;
	var byFactor=1;

	if(w<740){
	  var lift=0.90;
	}
	if(w>=740 & w<835){
	  var lift=0.91;
	}
	if(w>=835){
	  var lift=0.93;
	}
	if (imageWidth>w){	
	  byFactor = w / imageWidth;			
	  imageWidth = w;
	  imageHeight = imageHeight * byFactor;
	}
	if (imageHeight>h-adj){
	  byFactor = h / imageHeight;
	  imageWidth = (imageWidth * byFactor);
	  imageHeight = h; 
	}
	   
	var scrWidth = w-adj;
	var scrHeight = (h*lift)-adj;

	if (imageHeight>scrHeight){
  	  imageHeight=imageHeight*lift;
	  imageWidth=imageWidth*lift;
	}

	var posLeft=0;
	var posTop=0;

	if (hugger == "hug image"){
	  if (hugMargin == ""){
	    hugMargin = 0;
	  }
	  var scrHeightTemp = imageHeight - 0 + 220;          //  imageHeight - 0 + 2*hugMargin;
	  if (scrHeightTemp < scrHeight) {
		scrHeight = scrHeightTemp;
	  } 
	  var scrWidthTemp = imageWidth - 0 + 4;
	  if (scrWidthTemp < scrWidth) {
		scrWidth = scrWidthTemp;
	  }
	  
	  if (scrHeight<100){scrHeight=100;}
	  if (scrWidth<100){scrWidth=100;}

	  posTop =  ((h-(scrHeight/lift)-adj)/2);
	  posLeft = ((w-(scrWidth)-adj)/2);
 	}

	if (imageHeight > (h*lift)-adj || imageWidth > w-adj){
		imageHeight=imageHeight-adj;
		imageWidth=imageWidth-adj;
	}
	posTop = parseInt(posTop);
	posLeft = parseInt(posLeft);		
	scrWidth = parseInt(scrWidth); 
	scrHeight = parseInt(scrHeight);
	
	var agt=navigator.userAgent.toLowerCase();
	if (agt.indexOf("opera") != -1){
	  var args= new Array();
	  args[0]='parent';
	  args[1]=imageName;
	  var i ; document.MM_returnValue = false;
	  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
	} else {
	newWindow = window.open("portfolio/web_popup.php?count="+image+"","newWindow","width="+scrWidth+",height="+scrHeight+",left="+posLeft+",top="+posTop);
	}
}







function toggleregister(id) {
  if (document.getElementById) {
    var e = document.getElementById(id);
    if (e) {
      if (e.style.display !== "block") e.style.display = "block"
      else e.style.display = "none"
    }  
  }
}

function toggleDisplay(id) {
  if (document.getElementById) {
    var e = document.getElementById(id);
    if (e) {
      if (e.style.display !== "") e.style.display = ""
      else e.style.display = "none"
    }  
  }
}

function toggleAll() {
	var x = document.getElementsByTagName('div');
	for (var i=0;i<x.length;i++)
	{
		if (x[i].className == 'answer rahmen') {
			  if (x[i].style.display !== "") x[i].style.display = ""
      		  else x[i].style.display = "none"
		}
	}
}



