checkFrames();

function checkFrames(){
	if(!top.site && !top.content && typeof(window['vDontSetFrames']) == "undefined" && parent.parent.location.href.indexOf('/club/') < 1){
		vFileName = window.location.pathname.slice(window.location.pathname.lastIndexOf('/') + 1);
		vQueryString = '';
		if(window.location.href.indexOf('?') != -1)
			vQueryString = '&'+ window.location.href.slice((window.location.href.indexOf('?')) + 1);
		top.location.href = window.location.href.slice(0, window.location.href.indexOf('/', 7)) +'/default.asp?file='+ vFileName + vQueryString;
	}
	else if(parent.parent.location.href.indexOf('/club/') > 0){
		vStyleSheet = '/club/unimogpage.css';
		if(document.createStyleSheet){
			document.createStyleSheet(vStyleSheet);
		}
		else{
			var styles = "@import url(' "+ vStyleSheet +" ');";
			var newSS=document.createElement('link');
			newSS.rel='stylesheet';
			newSS.href='data:text/css,'+escape(styles);
			document.getElementsByTagName("head")[0].appendChild(newSS);
		}
	}
}
function fncSendMailold(lEmail){
	lEmail = lEmail.replace("[op]", "@")
	lEmail = lEmail.replace("[punt]", ".")
	document.location.href = "mailto:"+ lEmail
}
function fncSendMail(lEmail){
	lEmail = lEmail.replace(/\[op\]/g, "@")
	lEmail = lEmail.replace(/\[punt\]/g, ".")
	document.location.href = "mailto:"+ lEmail
}
function showFoto(vFoto, vAlt, vWidth, vHeight){
	if(!document.getElementById('fotoVergroten')){
		vBody = document.getElementsByTagName('body')[0];
		vFotoDiv = document.createElement('div');
		vFotoDiv.setAttribute('id', 'fotoVergroten');
		
		vBody.insertBefore(vFotoDiv, vBody.firstChild);
		
		vFotoVergroten = document.getElementById('fotoVergroten');
		vFotoVergroten.innerHTML = '<div class="fotovergroten_bg"></div><div id="fotovergroting"><a title="'+ vAlt +'" href="#" onclick="closeFoto();"></a></div>';
	}
	vFotoVergroting = document.getElementById('fotovergroting');
	vFotoVergroting.style.width = vWidth +'px';
	vFotoVergroting.style.height = vHeight +'px';
	vFotoVergroting.style.backgroundImage = 'url('+ vFoto +')';
	document.getElementById('fotoVergroten').style.display = '';
}
function closeFoto(){
	document.getElementById('fotoVergroten').style.display = 'none';
}
function vAlert(vOption, vTitel, vText, vAction, vId, vName, vEnctype){
	if(!document.getElementById('vAlert')){
		vBody = document.getElementsByTagName('body')[0];
		vAlertDiv = document.createElement('div');
		vAlertDiv.setAttribute('id', 'vAlert');
		
		vBody.insertBefore(vAlertDiv, vBody.firstChild);
		
		document.getElementById('vAlert').innerHTML = '<div class="alertdiv_bg"></div><div id="alertdiv"><div id="alertdivtitel"></div><div id="alertdivtext"></div><div id="alertdivbutton"></div></div>';
	}
	document.getElementById('alertdivtitel').innerHTML = '<div>'+ vTitel +'</div><a href="#" onclick="HidevAlert();">X</a>';
	document.getElementById('alertdivtext').innerHTML = vText;
	vAlertDivButton = document.getElementById('alertdivbutton');
	if(vOption == 1){
		vAlertDivButton.innerHTML = '<a href="#" onclick="HidevAlert();">Ok</a>';
	}
	else{
		vForm = '<form id="valertform" action="" method="post" '+ ((vEnctype)?'enctype="multipart/form-data"':'') +'>';
			vForm += '<input type="hidden" name="action" value="'+ vAction +'" />';
			vForm += '<input type="hidden" name="'+ ((vName)?vName:'id') +'" value="'+ vId +'" />';
			vForm += '<table style="width:100%;">';
				vForm += '<tr>';
					vForm += '<td style="width:50%;">';
						vForm += '<a href="#" class="button" style="float:right;" onclick="document.getElementById(&#039;valertform&#039;).submit();">Ja</a>';
					vForm += '</td>';
					vForm += '<td>';
						vForm += '<a href="#" class="button" onclick="HidevAlert();">Nee</a>';
					vForm += '</td>';
				vForm += '</tr>';
			vForm += '</table>';
		vForm += '</form';
		vAlertDivButton.innerHTML = vForm;
	}
	document.getElementById('vAlert').style.display = '';
}
function HidevAlert(){
	document.getElementById('vAlert').style.display = 'none';
}
