var smooth_timer;


function hidestatus(){
	window.status=' ';
	return true;
}



function changeScrollbarColor(){
	if (document.all){	
	    document.body.style.scrollbarBaseColor				= mainbgcolor;
	    document.body.style.scrollbar3dLightColor			= mainbgcolor;
		document.body.style.scrollbarArrowColor				= focuscolor;
		document.body.style.scrollbarDarkShadowColor		= mainbgcolor;
		document.body.style.scrollbarFaceColor				= mainbgcolor;
		document.body.style.scrollbarHighlightColor			= focuscolor;
		document.body.style.scrollbarShadowColor			= mainbgcolor;
		document.body.style.scrollbarTrackColor				= focuscolor;
  	}   
}

							

function upclock(){					
	var dte = new Date();	
	var daymonth = dte.getDate();
	var month = dte.getMonth()+1;			
	
	var hrs = dte.getHours();
	var min = dte.getMinutes();
	if (hrs == 0) hrs=12;
	if (daymonth<=9) daymonth='0'+daymonth;
	if (month<=9) month='0'+month;
	if (min<=9) min="0"+min;
	if(document.getElementById('div_clock')){
	document.getElementById('div_clock').innerHTML =daymonth + ' / ' + month+' :: '+hrs+':'+min};	
										
}



	
function setMenu(obj, status, page){
	var sImg = new String();		
	sImg = 'images/menu'+obj.id.slice(4)+'';
	if(status){
		sImg = sImg + '_mo';
	}
	else{

		if(page == retPageName(obj.id.slice(4))){
			sImg = sImg + '_a';
		}
	}
	
	obj.style.cursor='pointer';	
	obj.src = sImg+'.gif';
	
}

function setPage(obj){	
	var sFile;
	switch(parseInt(obj.id.slice(4))){		
		case 2:
			window.open('http://bleeker.hexon.cx/sc0338d7986af177b302147e9088a4f5c/zoek/', null,'height=768,width=1024,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
			break;
		case 3:
			window.open('http://bleeker.hexon.cx/sc0338d7986af177b302147e9088a4f5c/zoek/', null,'height=768,width=1024,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
			break;
			
			//break;
		default:
			sFile = retPageName(parseInt(obj.id.slice(4)));	
			window.location.href=sFile;	
	}
	
	
}

function retPageName(id){
	
	switch(parseInt(id)){
		case 1:
			return 'http://www.bleekermotoren.nl';		
		//case 3:
			//return 'http://www.yamaha-motor.nl/products/motorcycles/index.jsp';
		case 4:
			return 'webshop';
		case 5:
			return 'webshop';
		case 6:
			return 'contact.php';
		case 7:
			return 'links.php';
		default:
			return 'index';
	}
}




function setSearch(id, visible){
  var trObj = (document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']");
  if (trObj != null) {
    if (visible) {		
    	trObj.style.display='';
    	trObj.style.height='62px';		
		SetCookie('search', 1, 30);
    }
    else {
    	trObj.style.display='none';
		SetCookie('search', '', -1);
    }
  }
}

function showSearch(id) {
  var trObj = (document.getElementById) ? document.getElementById(id) : eval("document.all['" + id + "']");
  var iStep = 2;
  if(!bIsMSIE){iStep = 5}
  if (trObj != null) {
    if (trObj.style.display=="none") {    
      trObj.style.display="";
      smoothHeight(id, 0, 60, iStep, 'o');
      SetCookie("search", 1, 30);
    }
    else {
      smoothHeight(id, 60, 0, iStep, id);
      SetCookie("search", "", -1);
    }
  }
}

function smoothHeight(id, curH, targetH, stepH, mode) {
	
	diff = targetH - curH;
	var iPause = 20;
	
	if (Math.abs(diff) > stepH) {
		
		newH = (diff > 0) ? curH + stepH : curH - stepH;
	
		document.getElementById(id).style.height = newH + "px";
	
		if (smooth_timer) window.clearTimeout(smooth_timer);

		smooth_timer = window.setTimeout( "smoothHeight('" + id + "'," + newH + "," + targetH + "," + stepH + ",'" + mode + "')", iPause);
	}
	else if (mode != "o"){document.getElementById(id).style.display="none"}else{document.getElementById(id).style.height='62px'} 
}

function setPic(obj, w, h){				
	document.getElementById("showpic").src = obj.src.replace('tn_', 's_');
	document.getElementById("pic_width").value = w;
	document.getElementById("pic_height").value = h;
}

function showPic(obj){
	document.getElementById("showpic").src = obj.src.replace('tn_', 's_');
}

function showOriginal(oPic){				
	var iPos = oPic.src.indexOf('s_')+2;				
	popUp('showpic.php?pic='+oPic.src.substring(iPos), document.getElementById('pic_width').value, document.getElementById('pic_height').value, false);
}



function setSpecials(obj, event){
if(event){
	if(obj.value == '- bijzonderheden -'){obj.value = ''}
}
else{
	if(obj.value == ''){obj.value = '- bijzonderheden -'}
}	

}
