// JavaScript Document

function handleDisclaimer(){
	disclaimer();
}

function handleFeedBack(){
	feedback();
}

function handleMailThisPage(){
	mailThisPage();
}

function handleContact(){
	contact();
}


/*
	DISCLAIMER
*/
var disclaimerWrapper;
function disclaimer(){
	if(!disclaimerWrapper){
		var html = '';
		
		disclaimerWrapper = document.createElement('div');
		disclaimerWrapper.className = 'disclaimerWrapper';
		disclaimerWrapper.style.height = '0px';
		disclaimerWrapper.style.width = '0px';
		document.getElementsByTagName('body')[0].appendChild(disclaimerWrapper);
		
		
		// position of wrapper
		var xPos = document.body.clientWidth;
		xPos = parseInt((xPos / 2) - 300);
		disclaimerWrapper.style.left = xPos + 'px';

		html += '<h2>Disclaimer <a href="javascript:closeDisclaimer()"><img src="img/closePopup.gif" /></a></h2>';
		html += '<iframe src="disclaimer.cfm?" frameborder="0"></iframe>';
		
		disclaimerWrapper.innerHTML = html;
		
		disclaimer();
	}else{
		
		var height = disclaimerWrapper.style.height;
			height = parseInt(height.replace('px', ''));
			height = height + 9;
		var width = disclaimerWrapper.style.width;
			width = parseInt(width.replace('px', ''));
			width = width + 12;
		
		disclaimerWrapper.style.height =  height + 'px';
		disclaimerWrapper.style.width =  width + 'px';
		
		if(height < 500){
			setTimeout('disclaimer()', 0);
		}
		
	}
	
}


function closeDisclaimer(){
	document.getElementsByTagName('body')[0].removeChild(disclaimerWrapper);
	disclaimerWrapper = null;
}
/*
	// MAIL THIS PAGE
*/

/*
	MAIL THIS PAGE
*/
var mailThisPageWrapper;
function mailThisPage(){
	if(!mailThisPageWrapper){
		var html = '';
		
		mailThisPageWrapper = document.createElement('div');
		mailThisPageWrapper.className = 'mailThisPageWrapper';
		mailThisPageWrapper.style.height = '0px';
		mailThisPageWrapper.style.width = '0px';
		document.getElementsByTagName('body')[0].appendChild(mailThisPageWrapper);
		
		
		// position of wrapper
		var xPos = document.body.clientWidth;
			xPos = parseInt((xPos / 2) - 200);
		mailThisPageWrapper.style.left = xPos + 'px';

		html += '<h2>Mail this page <a href="javascript:closeMailThisPage()"><img src="img/closePopup.gif" /></a></h2>';
		html += '<iframe src="mailThisPage.cfm?" frameborder="0"></iframe>';
		
		mailThisPageWrapper.innerHTML = html;
		
		mailThisPage();
	}else{
		
		var height = mailThisPageWrapper.style.height;
			height = parseInt(height.replace('px', ''));
			height = height + 9;
		var width = mailThisPageWrapper.style.width;
			width = parseInt(width.replace('px', ''));
			width = width + 12;
		
		mailThisPageWrapper.style.height =  height + 'px';
		mailThisPageWrapper.style.width =  width + 'px';
		
		if(height < 300){
			setTimeout('mailThisPage()', 0);
		}
		
	}
	
}


function closeMailThisPage(){
	document.getElementsByTagName('body')[0].removeChild(mailThisPageWrapper);
	mailThisPageWrapper = null;
}
/*
	// MAIL THIS PAGE
*/



/*
	FEEDBACK
*/
var feedbackWrapper;
function feedback(){
	if(!feedbackWrapper){
		var html = '';

		feedbackWrapper = document.createElement('div');
		feedbackWrapper.className = 'feedbackWrapper';
		feedbackWrapper.style.height = '0px';
		feedbackWrapper.style.width = '0px';
		document.getElementsByTagName('body')[0].appendChild(feedbackWrapper);
		
		
		// position of wrapper
		var xPos = document.body.clientWidth;
			xPos = parseInt((xPos / 2) - 300);
		feedbackWrapper.style.left = xPos + 'px';

		html += '<h2>Feedback <a href="javascript:closeFeedBack()"><img src="img/closePopup.gif" /></a></h2>';
		html += '<iframe src="feedback.cfm" frameborder="0"></iframe>';
		
		feedbackWrapper.innerHTML = html;
		
		feedback();
	}else{
		
		var height = feedbackWrapper.style.height;
			height = parseInt(height.replace('px', ''));
			height = height + 8;
		var width = feedbackWrapper.style.width;
			width = parseInt(width.replace('px', ''));
			width = width + 12;
		
		feedbackWrapper.style.height =  height + 'px';
		feedbackWrapper.style.width =  width + 'px';
		
		if(height < 400){
			setTimeout('feedback()', 0);
		}
		
	}
	
}


function closeFeedBack(){
	document.getElementsByTagName('body')[0].removeChild(feedbackWrapper);
	feedbackWrapper = null;
}
/*
	// FEEDBACK
*/



/*
	CONTACT
*/
var contactWrapper;
function contact(){
	if(!contactWrapper){
		var html = '';

		contactWrapper = document.createElement('div');
		contactWrapper.className = 'contactWrapper';
		contactWrapper.style.height = '0px';
		contactWrapper.style.width = '0px';
		document.getElementsByTagName('body')[0].appendChild(contactWrapper);
		
		
		// position of wrapper
		var xPos = document.body.clientWidth;
			xPos = parseInt((xPos / 2) - 300);
		contactWrapper.style.left = xPos + 'px';

		html += '<h2>Contact ERIKS <a href="javascript:closeContact()"><img src="img/closePopup.gif" /></a></h2>';
		html += '<iframe src="contact.cfm" frameborder="0"></iframe>';
		
		contactWrapper.innerHTML = html;
		
		contact();
	}else{
		
		var height = contactWrapper.style.height;
			height = parseInt(height.replace('px', ''));
			height = height + 8;
		var width = contactWrapper.style.width;
			width = parseInt(width.replace('px', ''));
			width = width + 12;
		
		contactWrapper.style.height =  height + 'px';
		contactWrapper.style.width =  width + 'px';
		
		if(height < 400){
			setTimeout('contact()', 0);
		}
		
	}
	
}


function closeContact(){
	document.getElementsByTagName('body')[0].removeChild(contactWrapper);
	contactWrapper = null;
}
/*
	// CONTACT
*/



