
function Is() {
    var agent   = navigator.userAgent.toLowerCase();
    this.major  = parseInt(navigator.appVersion);
    this.minor  = parseFloat(navigator.appVersion);
    this.ns     = ((agent.indexOf('mozilla')   != -1) &&
                  (agent.indexOf('spoofer')    == -1) &&
                  (agent.indexOf('compatible') == -1) &&
                  (agent.indexOf('opera')      == -1) &&
                  (agent.indexOf('webtv')      == -1));
    this.ns2    = (this.ns && (this.major      ==  2));
    this.ns3    = (this.ns && (this.major      ==  3));
    this.ns4    = (this.ns && (this.major      ==  4));
    this.ns6    = (this.ns && (this.major      >=  5));
    this.ie     = (agent.indexOf("msie")       != -1);
    this.ie3    = (this.ie && (this.major      <   4));
    this.ie4    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   == -1));
    this.ie5    = (this.ie && (this.major      ==  4) &&
                  (agent.indexOf("msie 5.0")   != -1));
    this.ieX    = (this.ie && !this.ie3 && !this.ie4);
}

var is = new Is();



/*
This version of the functions can be called in either of these two ways:


elementReference.getRealLeft = getRealLeft;
elementReference.getRealTop = getRealTop;
trueX = elementReference.getRealLeft()
trueY = elementReference.getRealTop()
or:

anotherTrueX = getRealLeft(elementReference);
anotherTrueY = getRealTop(elementReference);
*/

function getRealLeft(el) {
    if (arguments.length==0) el = this;
    xPos = el.offsetLeft;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        xPos += tempEl.offsetLeft;
        tempEl = tempEl.offsetParent;
    }
    return xPos;
}

function getRealTop(el) {
    if (arguments.length==0) el = this;
    yPos = el.offsetTop;
    tempEl = el.offsetParent;
    while (tempEl != null) {
        yPos += tempEl.offsetTop;
        tempEl = tempEl.offsetParent;
    }
    return yPos;
}



//Advanced Email Check credit-
//By JavaScript Kit (www.javascriptkit.com)
//Over 200+ free scripts here!

var invalidaddress=new Array()
invalidaddress[0]="hotmail"
invalidaddress[1]="rocketmail"
invalidaddress[2]="yahoo"
invalidaddress[3]="zdnetmail"
//extend or shorten this list if neccessary

var testresults

function checkemail(){
var invalidcheck=0;
var str=document.emailform.email.value
var filter=/^(\w+(?:\.\w+)*)@((?:\w+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i
if (filter.test(str)){
var tempstring=str.split("@")
tempstring=tempstring[1].split(".")
for (i=0;i<invalidaddress.length;i++){
if (tempstring[0]==invalidaddress[i])
invalidcheck=1
}
if (invalidcheck!=1)
testresults=true
else{
	alert("Emailadressen van gratis webservices kunnen niet worden geaccepteerd.")
	document.emailform.email.focus()
testresults=false
}
}
else{
alert("S.v.p een geldig emailadres opgeven.")
document.emailform.email.focus()
testresults=false
}
return (testresults)
}

function checkbae(){
if (document.layers||document.getElementById||document.all)
return checkemail()
else
return true
}


function image_open(image_loc,img)
{
  HTML = "<html><title>Screenshot</title><style>body{margin:0px 0px 0px 0px}</style><body onBlur='top.close()'><img src='"+ image_loc +"' border=0 name=load_image onLoad='window.resizeTo(document.load_image.width+10,document.load_image.height+30)'></body></html>";
  popupImage = window.open('','_blank','toolbar=no,scrollbars=no');
  popupImage.document.open();
  popupImage.document.write(HTML);
  popupImage.document.close();
  obj_img = document.getElementById(img);
  obj_img.src= obj_img.src;
}


function checkImages()
{
 if(document.getElementById)
 {
  var imagesArr = new Array();
  var setDefaultErrImg="/media/portfolio/error.gif"; // Default image to be displayed on error
  var setDefaultErrTxt="Image Not Found"; // Default text to be displayed on error 
  imagesArr = document.getElementsByTagName("img");
  for(var i=0; i<imagesArr.length; i++)
  {
   if(!imagesArr[0].getAttribute("nc")=="1")
   {
    var tempImgAttrib=imagesArr[i].getAttribute("alt");
    imagesArr[i].setAttribute("alt","");
    if(imagesArr[i].width=="28" && imagesArr[i].height=="30")
    {
     imagesArr[i].src=setDefaultErrImg;
     imagesArr[i].setAttribute("alt",setDefaultErrTxt);
    }
    else
    {
     imagesArr[i].setAttribute("alt",tempImgAttrib);
    }
   }
  }
 }
}



//--------------------------------------------------------------------------
function getSize(type,showalert) {	  
	  if( typeof( window.innerWidth ) == 'number' ) {
	    //Non-IE
	    myWidth = window.innerWidth;
	    myHeight = window.innerHeight;
	  } else {
	    if( document.documentElement &&
		( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
	      //IE 6+ in 'standards compliant mode'
	      myWidth = document.documentElement.clientWidth;
	      myHeight = document.documentElement.clientHeight;
	    } else {
	      if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible		
		myWidth = document.body.clientWidth;
		myHeight = document.body.clientHeight;
	      }
	    }
	  }
	  if(showalert){
		  window.alert( 'Width = ' + myWidth );
		  window.alert( 'Height = ' + myHeight );
	  }
	  if(type=='width')
	  	return myWidth
	  if(type=='height')
	  	return myHeight 	
}
	
				
/*
Shake image script (onMouseover)- 
© Dynamic Drive (www.dynamicdrive.com)
For full source code, usage terms, and 100's more DHTML scripts, visit http://dynamicdrive.com
*/

//configure shake degree (where larger # equals greater shake)
var rector=3

///////DONE EDITTING///////////
var stopit=0 
var a=1

function init(which){
stopit=0
shake=which
shake.style.left=0
shake.style.top=0
}

function rattleimage(){

if ((!document.all&&!document.getElementById)||stopit==1)
return
if (a==1){
shake.style.top=parseInt(shake.style.top)+rector
}
else if (a==2){
shake.style.left=parseInt(shake.style.left)+rector
}
else if (a==3){
shake.style.top=parseInt(shake.style.top)-rector
}
else{
shake.style.left=parseInt(shake.style.left)-rector
}
if (a<4)
a++
else
a=1
//setTimeout("rattleimage()",50)
alert(parseInt(shake.offsetTop))
}

function stoprattle(which){
stopit=1
which.style.left=0
which.style.top=0
}






