window.onload = function() {
	if (document.getElementById) {

// apply new class to main nav links if screen size is less than 900px (assuming visitor has 800 by 600 screen res)
		if(document.documentElement.clientWidth < 900){
//			var nLinks = document.getElementById('head').getElementsByTagName("A");
//			for (var x=0; x<nLinks.length; x++) {
//				nLinks[x].className += " smallscr";
//			}
		if(document.documentElement.clientWidth < 900){ document.getElementById('head').className = "smallscr"; };

		}

//external links to open in a new window
		var anchors = document.getElementsByTagName('a');
		for (var i=0; i<anchors.length; i++){
			var anchor = anchors[i];
			if (anchor.getAttribute('href') && anchor.getAttribute('rel') == 'externe'){ anchor.target = '_blank'; anchor.className = 'extlink' }
		}
		
// rollover effect on portfolio images
		if(document.getElementById('port')){
			var images = document.getElementById('port').getElementsByTagName("img");
			for (var y=0; y<images.length; y++){
				if(images[y].className == 'roll'){
					images[y].onmouseover = function(){ this.src = this.src.replace(/.jpg/, "_o.jpg"); }
					images[y].onmouseout = function(){ this.src = this.src.replace(/_o.jpg/, ".jpg"); }
				}
			}
		}

// small form onfocus cleaning
	if(document.getElementById('smform')){
		var ffields = document.getElementById('smform').getElementsByTagName('input');
		for (f in ffields){
			ffields[f].onfocus = function () { if(this.value == this.defaultValue){ this.value=''; }};
			ffields[f].onblur = function () { if(this.value.replace(/\s+/g,"") == '' ){ this.value=this.defaultValue; }};
		}
	}


// search onfocus cleaning
		if(document.getElementById('searchbox')){
			var searchbox = document.getElementById('searchbox');
				searchbox.onfocus = function () { if(this.value == this.defaultValue){ this.value=''; }};
				searchbox.onblur = function () { if(this.value.replace(/\s+/g,"") == ''){ this.value=this.defaultValue; }};
		}

// scriptalicious scrollTo contenu
		if(document.getElementById('skip')){
			skiplink = document.getElementById('skip').getElementsByTagName('a')[0];
			skiplink.onclick = function(){ this.href.value="#"; Effect.ScrollTo('main'); return false; }
		}
		
// scriptalicious scrollTo haut
		if(document.getElementById('haut')){
			toplink = document.getElementById('haut').getElementsByTagName('a')[0];
			toplink.onclick = function(){ this.href.value="#"; Effect.ScrollTo('top'); return false; }
		}
		
		
}//end if document.getElementById
};//end windo.onload

