function toggleVis(obj) 
{
	var el = document.getElementById(obj);
    el.style.display = (el.style.display != 'none' ? 'none' : '' );
}

function showSubMenu(menu, submenu) 
{
	var elMenu 	= document.getElementById(menu);
	var el 		= document.getElementById(submenu);
	
	//if(elMenu)
	//	elMenu.style.background='url(' + publicdir + 'img/menu-bg-over.jpg)';
	if(el)
    	el.style.display = '';
}

function hideSubMenu(menu, submenu) 
{	
	var elMenu 	= document.getElementById(menu);
	var el 		= document.getElementById(submenu);
	
	//if(elMenu)
	//	elMenu.style.background='url(' + publicdir + 'img/menu-bg.jpg)';
	if(el)
    	el.style.display = 'none';	
}

function hidediv() 
{ 
	if (document.getElementById) 
	{ // DOM3 = IE5, NS6 
		document.getElementById('hidePicture').style.visibility = 'hidden'; 
	} 
	else 
	{ 
		if (document.layers) 
		{ // Netscape 4 
			document.hideShow.visibility = 'hidden'; 
		} 
		else 
		{ // IE 4 
			document.all.hideShow.style.visibility = 'hidden'; 
		} 
	} 
} 

function showdiv(image) 
{ 
	img = new Image();
	img.src = image;
	
	
	//when the picture is a long picture, scale it 
	if(img.height > img.width)
	{
		img.height -= 500;
		img.width  -= 300;
	}
	
	//set the new image
	document.getElementById('hidePicture').innerHTML = "<img src=" + image + " width='"+img.width+"' height='"+img.height+"'>";
	
	if (document.getElementById) 
	{   // DOM3 = IE5, NS6 
		document.getElementById('hidePicture').style.visibility = 'visible'; 
	}
	else 
	{ 
		if (document.layers) 
		{ // Netscape 4 
			document.hideShow.visibility = 'visible'; 
		} 
		else 
		{ // IE 4 
			document.all.hideShow.style.visibility = 'visible'; 
		} 
	} 
} 

function changeimg(subimg, elemid)
{
	var elem = document.getElementById(elemid);
	
	if(elem)
		elem.innerHTML = "<img src=\"" + subimg + "\">";
}

function CalcThumbSize(img, Maxheight, Maxwidth, linker, onclicker)
{
	var Newheight = Maxheight;
	var Newwidth = Maxwidth;
	
	image = new Image();
	image.src = img;
		
	//Als de hoogte groter is dan de breede
	if(image.height > image.width)
	{
		var ratio = image.height / Maxheight;
		var Newwidth = image.width / ratio;
	}
	else
	{
		var ratio = image.width / Maxwidth;
		var Newheight = image.height / ratio;
	}
		
	document.write("<a href=\""+linker+"\"> <img src=\""+img+"\" onMouseOver=\"changeimg('"+img+"','aanbod-detail-image')\" onclick=\""+onclicker+"\" height=\""+Newheight+"\" width=\""+Newwidth+"\"></a>");
}

function switchTab(tab)
{
	var tab = '#' + tab;
	
	if($(tab))
	{
		switch(tab)
		{
			case "#tab-omschrijving":
				$('#tab-locatie').hide();
				$('#tab-omschrijving').show();
			break;
			case "#tab-locatie":
				$('#tab-locatie').show();
				$('#tab-omschrijving').hide();				
			break;			
		}
	}
}

function loadTweets(id, loadUrl)
{
	$.ajaxSettings.cache = false;
	
	$(id).html("<div class=\"twitter-content-loader\"></div>");
	$(id).load(loadUrl + "?random=" + Math.random() * 99999, function(response, status, xhr) 
						{
							if (status == "error") 
							{
								//alert('Fout bij het ophalen van gegevens.');
								return false;
							}
						});	
	
	return true;
}

function search_submit()
{
	var search_keyword = document.getElementById('txtSearch').value; 
	var element_content = document.getElementById("content");
	//search function
	
}



