function lightup(imageobject, opacity){
 /*if (navigator.appName.indexOf("Netscape")!=-1
  &&parseInt(navigator.appVersion)>=5)
    imageobject.style.MozOpacity=opacity/100
 else if (navigator.appName.indexOf("Microsoft")!= -1 
  &&parseInt(navigator.appVersion)>=4)
    imageobject.style.filter="alpha(opacity="+ opacity + ");";
*/
if(opacity==0) imageobject.style.display='none'; else imageobject.style.display='';
}

function scrollbuttonns(currentpage,numpages)
{
	alert(currentpage+' of '+numpages);
}



$(document).ready(function()
{
	$('div.selectbox').click(function(){$(this).find('div').show()},function(){$(this).find('div').hide()});
	$('div.selectbox').hover(function(){},function(){$('div.selectitems').hide()});
	var search_active=0;
	$('#home_image').cycle({fx:'fade',speed:2000,timeout:5000});
	$('.collection_indoors').cycle({fx:'fade',speed:1000,timeout:5000,prev:'#collection_indoors_prev',next:'#collection_indoors_next'});
	$('.collection_outdoors').cycle({fx:'fade',speed:1000,timeout:5000,prev:'#collection_outdoors_prev',next:'#collection_outdoors_next'});
	$('.showroom_gallery a').lightBox();
	$('.project_thumbs a').lightBox();
	$('a.lightbox').lightBox();
	currentpage=$('body').attr('class');
	language=$('body').attr('id');
	if(language=='nl')language='_'+language; else language="";
	
	
	
	$("div.scrollable").scrollable({clickable:false, size:4});
	$("div.scrollable2").scrollable({clickable: false,size: 8});
	//, onSeek:function(){scrollbuttons(this.getStatus().page,this.getStatus().pages)}
	
	$('li.menuitem').each(function()
	{
		pagestatus='off';
		item_name=$(this).attr('id');
		if(currentpage==item_name)pagestatus='on';
		if(item_name=="collection")
		{
			this_menu_html='';
			this_menu_html+='<ul class="subhulp_off"><li><a href="index.php?tab=collection"><img src="clear.gif" style="width:150px;height:37px;"></a></li></ul>';
			this_menu_html+='<ul class="submenu_off"><li>';
			this_menu_html+='<div class="menu_indoor"><a href="index.php?tab=collection&maincat=1"><img src="images/indoor.jpg" alt=""></a>';
			this_menu_html+= document.getElementById('collection_indoors_links').innerHTML;
			this_menu_html+='</div>';
			this_menu_html+='<div class="menu_outdoor"><a href="index.php?tab=collection&maincat=2"><img style="" src="images/outdoor.jpg" alt=""></a>';
			this_menu_html+= document.getElementById('collection_outdoors_links').innerHTML;
			this_menu_html+='</div>';
			this_menu_html+='</li></ul><img class="menuimage" src="images/'+item_name+'_'+pagestatus+language+'.gif" alt="">';
			$(this).html(this_menu_html);
		}
		else
		{
			$(this).html('<img class="menuimage" src="images/'+item_name+'_'+pagestatus+language+'.gif" alt="">');
		}
	});	
	
	
	$('li.menuitem').hover(function()
	{
		pagestatus='on';
		item_name=$(this).attr('id');
		if(item_name!="search") $(this).find('img.menuimage').attr('src','images/'+item_name+'_'+pagestatus+language+'.gif');
		if(item_name=='collection')
		{
			$(this).find('ul.submenu_off').addClass('submenu_on');
			$(this).find('ul.subhulp_off').addClass('subhulp_on');
		}
	},
	function()
	{
		pagestatus='off';
		item_name=$(this).attr('id');
		if(item_name!=currentpage&&item_name!='search') $(this).find('img.menuimage').attr('src','images/'+item_name+'_'+pagestatus+language+'.gif');
		if(item_name=='collection')
		{
			$(this).find('ul.submenu_off').removeClass('submenu_on');
			$(this).find('ul.subhulp_off').removeClass('subhulp_on');
		}
	});
	
	$('li.menuitem').click(function()
	{
		item_name=$(this).attr('id');
		url=item_name;
		if(item_name=='lot1038')url='lot1038&pid=14';
		if(item_name=='contact')url='contact&pid=17';
		if(item_name=='downloads')url='lot1038&pid=21';
		if(item_name=='tech')url='lot1038&pid=20';
		if(item_name=='news')url='lot1038&pid='+first_news_page;
		if(item_name=='collection')url='';
		if(item_name=="search")
		{
			if(search_active==0)
			{
				pagestatus='on';
				search_active=1;
				$(this).find('img.menuimage').attr('src','images/'+item_name+'_'+pagestatus+language+'.gif');
				lightup(document.getElementById('searchbox'),100);
			}
			else
			{
				pagestatus='off';
				search_active=0;
				$(this).find('img.menuimage').attr('src','images/'+item_name+'_'+pagestatus+language+'.gif');
				lightup(document.getElementById('searchbox'),0);
			}
		}
		else
		{
			if(url!="")window.location = 'index.php?tab='+url;
		}
	});
	
	
	
});