/*Full screen window opener script: */
function winopen() {

// convert all characters to lowercase to simplify testing 
var agt=navigator.userAgent.toLowerCase(); 

//BROWSER VERSION
// Note: On IE5, these return 4, so use is_ie5up to detect IE5. 
var is_major = parseInt(navigator.appVersion); 
var is_minor = parseFloat(navigator.appVersion); 

//BROWSER TYPE 
var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1) 
            && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1) 
            && (agt.indexOf('webtv')==-1));
var is_nav4up = (is_nav && (is_major >= 4 ));  
var is_nav5up = (is_nav && (is_major >= 5));
var is_ie   = (agt.indexOf("msie") != -1); 
var is_ie3  = (is_ie && (is_major < 4)); 
var is_ie4  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")==-1) );
var is_ie4up  = (is_ie  && (is_major >= 4));
var is_ie5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );  
var is_ie5up  = (is_ie  && !is_ie3 && !is_ie4);  
var is_dom = (document.getElementById);

//PLATFORM 
var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
var is_mac   = (agt.indexOf("mac")!=-1);
var is_sun   = (agt.indexOf("sunos")!=-1);
var is_irix  = (agt.indexOf("irix") !=-1);    // SGI
var is_hpux  = (agt.indexOf("hp-ux")!=-1);
var is_aix   = (agt.indexOf("aix") !=-1);      // IBM
var is_linux = (agt.indexOf("inux")!=-1);
var is_sco   = (agt.indexOf("sco")!=-1) || (agt.indexOf("unix_sv")!=-1);
var is_unixware = (agt.indexOf("unix_system_v")!=-1); 
var is_mpras    = (agt.indexOf("ncr")!=-1); 
var is_reliant  = (agt.indexOf("reliantunix")!=-1);
var is_dec   = ((agt.indexOf("dec")!=-1) || (agt.indexOf("osf1")!=-1) || 
       (agt.indexOf("dec_alpha")!=-1) || (agt.indexOf("alphaserver")!=-1) || 
       (agt.indexOf("ultrix")!=-1) || (agt.indexOf("alphastation")!=-1)); 
var is_sinix = (agt.indexOf("sinix")!=-1);
var is_freebsd = (agt.indexOf("freebsd")!=-1);
var is_bsd = (agt.indexOf("bsd")!=-1);
var is_unix  = ((agt.indexOf("x11")!=-1) || is_sun || is_irix || is_hpux || 
             is_sco ||is_unixware || is_mpras || is_reliant || 
             is_dec || is_sinix || is_aix || is_linux || is_bsd || is_freebsd);


//url fuer weiterleitung
var targeturl="/flash_showcase/showcase.html";

if (is_win || is_linux) {

    if (is_nav) {

    var w = screen.availWidth-10;
    var h = screen.availHeight;
    newwin=window.open('','','screenX=0,screenY=0,left=0,top=0,width='+w+',height='+h+'');
    }
//explorer
    else {
    var w = screen.width;
    var h = screen.height;
    newwin=window.open('','','screenX=0,screenY=0,left=0,top=0');
    newwin.resizeTo(w,h);
    }

}

//Mac
else if (is_mac) {
  //navigator
     if (is_nav) {
     var w = screen.availWidth-13;
     var h = screen.availHeight-27;
     newwin=window.open('','','screenX=0,screenY=0,left=0,top=0,width='+w+',height='+h+'');
     }
//explorer
  else
     {
	 var w = screen.width-13;
     var h = screen.height;
     newwin=window.open('','','screenX=0,screenY=0,left=0,top=0');
     newwin.resizeTo(w,h);
     }
} 

newwin.location=targeturl;
}


function checkHyperlinks()
{
  if (!document.getElementById) return;
  var ao = document.getElementsByTagName('A');
  var iao = ao.length;
  /*for (var i = 0; i < iao; i++) {
    ao[i].onclick = function() { this.blur(); }
  }*/
}

                         
    /* popup functions for projects, shows detailed informations in popup */
    var attribWithoutAll="location=no,menubar=no,toolbar=no,status=no";
    attribWithoutAll+=",resizable=no,scrollbars=no,width=600,height=400";
    var subwindow=0;
    function ClosePopUp(){
      if (!subwindow) { return; }  
      if (subwindow.closed) { return; }  
      subwindow.close();
    }
    
    function detailShow(target){
      subwindow=window.open(target,"Detail",attribWithoutAll);
      subwindow.moveTo(10,50); 
    }
  
 function alternate(id){
 /*  function colors rows */
 if(document.getElementsByTagName){  
   var table = document.getElementById(id);  
   var rows = table.getElementsByTagName("tr");  
   var a = 0;
   for(i = 0; i < rows.length-3; i++){          
 //manipulate rows
     if(i % 4 == 0){
       a = i+3;
       rows[a].className = "color-row";
     }      
   }
 }
}

function myOpenWindow(url, w, h) {
  var window_left=(screen.width-w)/2;
  var window_top=(screen.height-h)/2;
  window.open(url, "","width=" + w + ",height=" + h + ",top=" + window_top + ",left=" + window_left + ",scrollbars=0");
} 

function myOpenWindow2(url, w, h) {
  var window_left=(screen.width-w)/2;
  var window_top=(screen.height-h)/2;
  window.open(url, "","width=" + w + ",height=" + h + ",top=" + window_top + ",left=" + window_left + ",scrollbars=1");
}

/*var HoverEffect = Class.create();
HoverEffect.prototype = {

  initialize: function(img, hover_url)
  {
    this.img = $(img);
    this.img.Controller = this;
    
    this.hoverImage = document.createElement('img');
    this.hoverImage.src = hover_url;
    this.hoverImage.style.display = 'none';
    this.img.parentNode.appendChild(this.hoverImage);
    
    this.defaultSrc = this.img.src;
    this.hoverSrc = this.hoverImage.src;
    
    Event.observe(this.img, 'mouseover', this.OnMouseOver);
    Event.observe(this.img, 'mouseout', this.OnMouseOut);
    
    return this;
  },
  
  OnMouseOver: function(e)
  {
    var img = Event.element(e);
    var c = img.Controller;
    img.src = c.hoverSrc;
  },
  
  OnMouseOut: function(e)
  {
    var img = Event.element(e);
    var c = img.Controller;
    img.src = c.defaultSrc;
  }
}*/