
var footerH = 327;
var headerH = 192;

var argL = 0; // default

// ======================================================
function doresize() {
	//setH('left','content','right');
	//setH('content','right');
	setH('content');

	// give the id's of all concerning columns inside 'container'
	// Each column stretches its height due to its content :
	// the footer top position is computed after the page is loaded : under the heighest column
}

// ======================================================
function setH() {
	argL = setH.arguments.length;

	var allColH = colH(setH.arguments);
	var windowH = document.body.clientHeight - headerH;
	var fillH = windowH - footerH;
	var TFfill = (footerH + allColH < windowH);
	var daH = TFfill ? fillH : allColH;

	for (var i=0;i < argL;i++) {
		document.getElementById(setH.arguments[i]).style.height = daH + "px";

		if (setH.arguments[i] == 'content') {
			if (document.getElementById('content-text')) {
				document.getElementById('content-text').style.height = (daH - 224 - 18) + "px";
			}
		}

		document.getElementById(setH.arguments[i]).style.marginBottom = (TFfill ? 0 : footerH) + "px";
	}

	document.getElementById('footer').style.top = (daH + headerH) + "px";
	document.getElementById('footer').style.visibility = "visible";
}

// ======================================================
function colH(aColID) { // Array containing all IDs of the concerning COLumns
	var i;
	var oH = 0;
	var cOH = new Array();

	for (i=0;i < argL;i++) {
		document.getElementById(aColID[i]).style.height = 'auto';
		cOH[i] = document.getElementById(aColID[i]).offsetHeight;
	}

	for (i=0;i < argL;i++) {
		if (cOH[i] > oH)
			oH = cOH[i];
	}

	return oH;
}

// ======================================================
function miMV(ID) {
	document.getElementById("L"+ID).style.backgroundPosition = "0px -35px";
}

// ======================================================
function miMT(ID) {
	document.getElementById("L"+ID).style.backgroundPosition = "0px 0px";
}

// ======================================================
function subMV(ID) {
	miMV(ID);
	document.getElementById("U"+ID).style.display = 'block';
}

// ======================================================
function subMT(ID) {
	miMT(ID);
	document.getElementById("U"+ID).style.display = 'none';
}

// ======================================================
function imgPopClose() {
	document.getElementById('imgPopDiv').style.display = 'none';
}

// ======================================================

function submit_url() {
	var url = window.location.href;
	var url_naar = "http://new.aerosoldesign.nl/send-friend/?link=" + url;
	//alert(url);
	//alert(url_naar);
	window.open(url_naar,null, 'height=320,width=514,status=yes,toolbar=no,menubar=no,location=no');
	//alert(url_naar);
	}

// ======================================================

var accordion=function(){
	var tm=sp=4;
	function slider(n){this.nm=n; this.arr=[]}
	slider.prototype.init=function(t,c,k){
		var a,h,s,l,i; a=document.getElementById(t); this.sl=k?k:'';
		h=a.getElementsByTagName('dt'); s=a.getElementsByTagName('dd'); this.l=h.length;
		for(i=0;i<this.l;i++){var d=h[i]; this.arr[i]=d; d.onclick=new Function(this.nm+'.pro(this)'); if(c==i){d.className=this.sl}}
		l=s.length;
		for(i=0;i<l;i++){var d=s[i]; d.mh=d.offsetHeight; if(c!=i){d.style.height=0; d.style.display='none'}}
	}
	slider.prototype.pro=function(d){
		for(var i=0;i<this.l;i++){
			var h=this.arr[i], s=h.nextSibling; s=s.nodeType!=1?s.nextSibling:s; clearInterval(s.tm);
			if(h==d&&s.style.display=='none'){s.style.display=''; su(s,1); h.className=this.sl}
			else if(s.style.display==''){su(s,-1); h.className=''}
		}
	}
	function su(c,f){c.tm=setInterval(function(){sl(c,f)},tm)}
	function sl(c,f){
		var h=c.offsetHeight, m=c.mh, d=f==1?m-h:h; c.style.height=h+(Math.ceil(d/sp)*f)+'px';
		c.style.opacity=h/m; c.style.filter='alpha(opacity='+h*100/m+')';
		if(f==1&&h>=m){clearInterval(c.tm)}else if(f!=1&&h==1){c.style.display='none'; clearInterval(c.tm)}
	}
	return{slider:slider}
}();




