/*
###################################### 
Sikring af E-mails 
######################################
*/

function Mail(name, topdomain, domain)
{

  var mail = '';
 
  mail += '<a href="mailto:';
  mail += name;
  mail += '@';
  mail += topdomain;
  mail += '.';
  mail += domain;
  mail += '">'+name+'@'+topdomain+'.'+domain+'</a>';
 
  return mail;
 }

function ballanceTables(tabID1, tabID2)
{
  var tab1 = document.getElementById(tabID1);
  var tab2 = document.getElementById(tabID2);
  if(tab1 != null && tab2 != null)
  {
    if(tab1.clientHeight > tab2.clientHeight)
      return tab2.style.height = tab1.clientHeight + "px";
    else
      return tab1.style.height = tab2.clientHeight + "px";
  }
} 

/*
###################################### 
Placering af white square
######################################
*/


// browser detection
var detect = navigator.userAgent.toLowerCase();
var browser;


if (checkIt('safari')) browser = "Safari"
if (checkIt('opera'))  browser = "Opera"
if (checkIt('msie'))   browser = "explorer"
if (checkIt('firefox'))browser = "firefox"
if (checkIt('gecko'))  browser = "mozilla"

function checkIt(string) {
place = detect.indexOf(string)
if (place != -1) {
return true;
}
	
}


function renderPositions() 
{

 var width, CWidth; 

 if (document.body.offsetWidth)            width = document.body.offsetWidth; /* firefox */
 if (document.documentElement.clientWidth) width = document.documentElement.clientWidth; /* explorer 6.0  */  
 if (document.body.clientWidth)            width = document.body.clientWidth; 
 
 CWidth = (width-1004)/2;

 if(width > 1004)
 {
 
    switch(browser)
    {
 
    case "explorer":
       document.getElementById('whitesquare').style.left  = (CWidth+182)+'px';
	break;
	
    case "firefox":
       document.getElementById('whitesquare').style.left  = (CWidth+182)+'px';
	break;
	
	case "mozilla":
       document.getElementById('whitesquare').style.left  = (CWidth+182)+'px';
	break;
	
    }

       
 }
 
 else
 {


    switch(browser)
    {
 
    case "explorer":
       document.getElementById('whitesquare').style.left  = 183+'px';
 	break;
	
    case "firefox":
       document.getElementById('whitesquare').style.left  = 183+'px';
	break;
	
    }

 }
 
}


  window.onload = function()
{
  renderPositions(); 
  
}
  
window.onresize = renderPositions;


