function checkDWLPopup() {
	console.log('errcheck');
	var err=0;
 	if(document.getElementById('dwl-name').value == '')
 		{$('dwl-name').addClass('formerror'); err=1;}
 	else $('dwl-name').removeClass('formerror');
 	if(document.getElementById('dwl-surname').value == '')
 		{$('dwl-surname').addClass('formerror'); err=1;}
 	else $('dwl-surname').removeClass('formerror');
 	if(document.getElementById('dwl-jobtitle').value == '')
 		{$('dwl-jobtitle').addClass('formerror'); err=1;}
 	else $('dwl-jobtitle').removeClass('formerror');
 	if(document.getElementById('dwl-company').value == '')
 		{$('dwl-company').addClass('formerror'); err=1;}
 	else $('dwl-company').removeClass('formerror');
 	if(document.getElementById('dwl-country').value == '')
 		{$('dwl-country').addClass('formerror'); err=1;}
 	else $('dwl-country').removeClass('formerror');
 	filter = /^([a-zA-Z0-9_.-])+@(([a-zA-Z0-9-])+.)+([a-zA-Z0-9]{2,4})+$/;
 	if (!filter.test(document.getElementById('dwl-email').value))
 		{$('dwl-email').addClass('formerror'); err=1;}
 	else $('dwl-email').removeClass('formerror');
 	if(err!=0)
 		return false;
	
	console.log(shareurl);
	setTimeout('self.location="'+shareurl+'"',2500);
}
var OPEN_POPUP_SPEED	= 400;
var DownloadPopup = new Class({
	Implements: [Events],
	Binds: ['close', 'submitClicked', 'onScroll'],
	initialize: function(__name,__modc) {
		this.name		= __name;
		this.modc		= __modc;
		this.setup();
	},
	
	containerDiv	: 0,
	formDiv			: 0,
	isOpen			: false,
	
	setup: function() {
		this.containerDiv	= new Element('div');
		this.containerDiv.addClass('lightbox');
		
		this.createHtml();
		if (!SUPPORT_OPACITY) {
			this.containerDiv.setStyle('opacity', 0);
			this.formDiv.setStyle('opacity', 0);
			this.formDiv.setAnimationProperties(['opacity'], [OPEN_POPUP_SPEED], [''], [0]);
		}
		
		this.containerDiv.setAnimationProperties(['opacity'], [OPEN_POPUP_SPEED], [''], [0]);
		
		if (!SUPPORT_POSITION_FIXED) {
			window.addEvent('scroll', this.onScroll);
		}
		
		this.open();
		this.resize(window.getSize().x, window.getSize().y);
		
//		$('submitDownloadForm').addEvent('click', this.submitClicked);
	},
	
	onScroll: function(e) {
		var scrolled		= window.getScroll().y,
			windowHeight	= window.getSize().y,
			formHeight		= this.formDiv.getSize().y,
			diff			= windowHeight - formHeight,
			toTop			= Math.round( scrolled + +(diff * .5) );
			
		this.formDiv.setStyle('margin-top', toTop + 'px');
	},
	
	createHtml: function() {
		var bgDiv		= new Element('div');
		bgDiv.addClass('bg');
		bgDiv.inject(this.containerDiv);
		
		bgDiv.addEvent('click', this.close);
		
		this.formDiv	= new Element('div');
		this.formDiv.addClass('contact-form-holder');
		this.formDiv.inject(this.containerDiv);
		this.formDiv.set('html', this.getFormHtml());
		this.formDiv.getElements('.close-popup-btn').addEvent('click', this.close);
	},
	
	getFormHtml: function() {
		var html	= '
' +
			'Thank you
Your form has been sent
Submit failed
Please try again