// BASE URL!
   var basehref = "http://www.ysebaert.be/preview/";

// function to show/hide the products in the overview.

function showHide(id){
		
	var ulC = document.getElementById('hide' + id);
	var imC = document.getElementById('img' + id);
	
	if (ulC && imC){
		if (ulC.style.display == "none"){
			ulC.style.display = "block";
			imC.src = basehref+"assets/collapse.gif";
		}else{
			ulC.style.display = "none";
			imC.src = basehref+"assets/expand.gif";
		}
	}
	
}

function noSpam(to, dom){
	
	document.location.href = 'mailto:' + to + '@' + dom;
	
}

function mnoSpam(img, action, uri, to, dom){
	if (action == 'hover'){
		window.status = 'mailto:' + to + '@' + dom;
		img.src = 'http://scripts.guideline.net/mailhover.php?text=' + uri;
	}else{
		window.status = '';
		img.src = 'http://scripts.guideline.net/toImg.php?text=' + uri;		
	}
}

function toggle(id, trigger){
	var _$ = trigger;
	var $ = document.getElementById(id);
	if ($.style.display == 'block'){
		$.style.display = 'none';
		_$.className = 'faqqer';
	}else{
		$.style.display = 'block';
		_$.className = 'faqqerl';
	}
	
}

function dtoggle(id){
	var $ = document.getElementById(id);
	if ($.style.display == 'block'){
		$.style.display = 'none';
	}else{
		$.style.display = 'block';
	}
	
}

			window.onload =  init;

			var navVis = false;
			var navSlidH = null;
			var iNav = null;
			var _pic = null;
			var _sel = null;
			var _desc = null;
			var _cul = null;
			var $_fjah = null;
			
			function init(){
				
				if (document.getElementById('thumb1')){
					var oNav = document.getElementById('navigate');
					iNav = document.getElementById('slideNav');
					_pic = document.getElementById('picture');
					navSlidH = new joinkFX(oNav, 'outCubic', 20, 'height,top', '150,-150', '-110,110');
					navSlidH.setFunc(alterDown);
					_sel = document.getElementById("thumb1");
					_cul = document.getElementById('cul1');
					_sel.className = 'selected';
					_desc = document.getElementById('description');
				}
				
	  			$_fjah = new joinkJAH();
				new hoverBalloon();
				new Newsticker('ticker',8);
			
				if (document.getElementById('accordeon')){
					new Accordeon('accordeon');
				}
				
			}
			
			function navToggle(){
				if (!navVis){
					navVis = true;
					navSlidH.move();
				}
			}
			
			function alterDown(){
				iNav.src = basehref+'assets/fotos/slide_arrow_up.gif';
				navSlidH.setStart('40,-40');
				navSlidH.setDist('110,-110');
				navSlidH.setFunc(alterUp);
				navVis = false;
			}
			
			function alterUp(){
				iNav.src = basehref+'assets/fotos/slide_arrow_down.gif';
				navSlidH.setStart('150,-150');
				navSlidH.setDist('-110,110');
				navSlidH.setFunc(alterDown);
				navVis = false;				
			}
			
			function changeImage(newSrc, sel, desc){
				/*
				document.getElementById('description').innerHTML = desc;
				_sel.className = "";
				_sel = document.getElementById(sel);
				_sel.className = "selected";
				_pic.src = newSrc;
				*/
				
				document.getElementById('picture').src = newSrc;
				_sel.className = "";
				_sel = document.getElementById(sel);
				_sel.className = "selected";				
				document.getElementById('fotodesc').innerHTML = desc;
			}
	
			function changeDesc(txt){
			}
	
var $_archtxt = "";
			
function showHover(txt){
	if ($_archtxt == ""){
		$_archtxt = document.getElementById('archive').innerHTML;
	}
	
	if (txt != ""){
		document.getElementById('archive').innerHTML = txt;
	}else{
		document.getElementById('archive').innerHTML = $_archtxt;
	}
}

   
	function showlarge(url, breedte, hoogte){
	var plaats = 'popup';
	fotovenster = window.open(url,"_depopup","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no,copyhistory=yes,width="+breedte+",height="+hoogte+",top="+((screen.height)?(screen.height-hoogte)/2:100)+",left="+((screen.width)?(screen.width-breedte)/2:100)+",");
	fotovenster.document.writeln("<html><head><title>" + plaats + "</title>"); 
	fotovenster.document.writeln("</head>"); 
	fotovenster.document.writeln("<body style=\"margin:0px;overflow:hidden;\">");
	fotovenster.document.writeln("<img src=\"" + url + "\" style=\"cursor:pointer;\" onclick=\"window.close();\" vspace=\"0\" hspace=\"0\" alt=\"Click to close\" />"); 
	fotovenster.document.writeln("</body></html>"); 
	fotovenster.document.close();
	
	}
	function popup(url, breedte, hoogte){
		var plaats = 'wartelwizard';
		if (!breedte){
			breedte = 300;
		}
		if (!hoogte){
			hoogte = 200;
		}
		window.open(url,"_depopup","toolbar=no,location=no,directories=no,scrollbars=yes,status=no,menubar=no,resizable=no,copyhistory=yes,width="+breedte+",height="+hoogte+",top="+((screen.height)?(screen.height-hoogte)/2:100)+",left="+((screen.width)?(screen.width-breedte)/2:100)+",");
	}
	
function showDesc(id){
	document.getElementById('archive').innerHTML = document.getElementById('dau' + id).innerHTML;
}

function getInfoform(){
	var loginForm = document.getElementById('loginForm');
	$_fjah.setParams(loginForm);
	$_fjah.setHtmlObj('infoLogin');
	$_fjah.doRequest('/obj/login/getLogin.php', 'POST');
	var $_ejah = new joinkJAH();
	$_ejah.setParams(loginForm);
	$_ejah.setHtmlObj('infoData');
	$_ejah.doRequest('/obj/login/getExtraData.php', 'POST');
}

function checkCard(){
	cn = document.getElementById('cardnumber');
	cv = document.getElementById('cardverif');
	$_fjah.setFunction(cardVerif);
	$_fjah.doRequest('/obj/webstore/checkcard.php?n=' + cn + '&t=' + cv, 'GET');
}

function cardVerif(){
	cn = document.getElementById('cardnumber');
	cv = document.getElementById('cardverif');	
	if ($_fjah.response == 'true'){
		cn.className = 'cardCorrect';
		cv.className = 'cardCorrect';		
	}else{
		cn.className = 'cardWrong';
		cv.className = 'cardWrong';				
	}
}

/*
function showImage(img){
	var right = document.getElementById('archive');
	var i = new Image();
	i.src = img;
	i.width = 160;
	i.style.marginTop = document.body.scrollTop + 300 + 'px';
	right.innerHTML = '';
	right.appendChild(i);
}

function hideImage(){
	var right = document.getElementById('archive');
	right.innerHTML = '';
}
*/