/*type =de gewenste site type (mobiel of default)
//url  =de redirect url van de gerelateerde pagina op de gewenste site type*/
function switchSite(type,url)
{
	var today = new Date();
	var expire = new Date();
	expire.setTime(today.getTime() + 3600000*24*30);			
	switch(type.toLowerCase())
	{
		case 'mobile':	
			window.location = url;
		break;
		default:
			window.location = url;
		break;
	}
}

var _type;
var _url;
function AddSwitch(type,url)
{
	_type = type;
	_url = url;
	
	var html = [];
	switch(type.toLowerCase())
	{
		case 'mobile':
			html.push('<a class="switchsite" href="#" onclick="switchSite(\''+type+'\',\''+url+'\'); return false;"><img border="0" src="../gfx/kaart/icons/icon_'+type+'.gif" /></a>');
			if($!=undefined)
			{	$(document).ready(function(){
					if($(".switchsite").length>0)
						return;
					var items = $("#contentinner .rightcolumn h2,#contentinner .rightcolumn h1");
					if(items.length>0)
					{
						var item = $(items)[0];
						html = '<a style=\"float:right;\" class="switchsite" href="#" onclick="switchSite(\''+type+'\',\''+url+'\'); return false;"><img border="0" src="../gfx/kaart/icons/icon_'+type+'.gif" /></a>';
						$(item).before(html);
					}else{
						if($("#flash").length>0)
						{
							html = '<a style=\"float:right; position:absolute;\" class="switchsite" href="#" onclick="switchSite(\''+type+'\',\''+url+'\'); return false;"><img border="0" src="../gfx/kaart/icons/icon_'+type+'.gif" /></a>';
							$("#flash").before(html);
						}
					}
				});
			}else{
				document.write(html.join(''));
			}
		break;
	}
}

function gotoweburl()
{
	window.location = (_url==undefined?'/':_url);
}

function AddMenuelelemt(type,url)
{
	var html = [];
	var menuitems = document.getElementById('bottommenu');
	if(menuitems)
	{
		html.push('<a class="navLink" href="#" onclick="switchSite(\''+type+'\',\''+url+'\'); return false;">PC versie</a>');
		
		var liTag = document.createElement("li");
		liTag.className ='mli'+menuitems.children.length+'-bottommenu';
		liTag.innerHTML = html.join('');
		menuitems.appendChild(liTag);	
	}
}
