/*
PrintVersion
*/

function printVersionClaranet(cellid) {
	var docTitle=window.document.title;
	var docHead=document.getElementsByTagName("head")[0].innerHTML;

	/* These functions make the JavaCode for the DeluxeMenu commented.
	 * This fixes the continues load for the popup in Firefox. */
	docHead = docHead.replace("<!-- Deluxe Menu -->", "<!-- Deluxe Menu");
	docHead = docHead.replace("<!-- (c) 2005, Deluxe-Menu.com -->", "(c) 2005, Deluxe-Menu.com -->");

	var docContent=document.getElementById(cellid).innerHTML;

	var prWindow;

	prWindow = window.open('','thePrWindow','width=603,height=480,menubar,resizable,toolbar,scrollbars');

	prWindow.document.open();

	prWindow.document.write('\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">\n\
<html>\n\
<head>'+docHead+'</head>\n\
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="default">\n\
	<table width="100%" cellpadding="0" cellspacing="0" border="0">\n\
		<tr>\n\
			<td colspan="2" align="right"><img src="/data/static/images/clara/logo-claranet-print.gif"></td>\n\
			<td>&nbsp;</td>\n\
		</tr>\n\
		<tr>\n\
			<td>&nbsp;</td>\n\
			<td>\n'+docContent+'</td>\n\
			<td>&nbsp;</td>\n\
		</tr>\n\
		<tr>\n\
			<td colspan="3">&nbsp;</td>\n\
		</tr>\n\
	</table>\n\
</body>\n\
</html>');

	prWindow.document.close();
	prWindow.focus();
}

function printVersionIAEBART(cellid) {
	var portalName = 'iae';
	var match_via = window.location.href.match(/^http:\/\/iaesite\.(vianetworks)\.nl\/.*/);
	var match_iae = window.location.href.match(/^http:\/\/www.(iae).nl/);
	var match_bart = window.location.href.match(/^http:\/\/www\.(bart)\.nl\/.*/);
	//var match = window.location.href.match(/^http:\/\/([^.]+)(\.uk)?\.oce-bs\.(com|co\.uk)\/.*/);
	if ( match_via != null ) {
		portalName = 'iae';       
	}
	if ( match_iae != null ) {
		portalName = match_iae[1];       
	}
	if ( match_bart != null ) {
		portalName = match_bart[1];       
	}
		
	var docTitle=window.document.title;
	var docHead=document.getElementsByTagName("head")[0].innerHTML;

	/* These functions make the JavaCode for the DeluxeMenu commented.
	 * This fixes the continues load for the popup in Firefox. */
	docHead = docHead.replace("<!-- Deluxe Menu -->", "<!-- Deluxe Menu");
	docHead = docHead.replace("<!-- (c) 2005, Deluxe-Menu.com -->", "(c) 2005, Deluxe-Menu.com -->");

	var docContent=document.getElementById(cellid).innerHTML;

	var prWindow;

	prWindow = window.open('','thePrWindow','width=603,height=480,menubar,resizable,toolbar,scrollbars');

	prWindow.document.open();

	prWindow.document.write('\
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">\n\
<html>\n\
<head>'+docHead+'</head>\n\
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" class="default">\n\
	<table width="100%" cellpadding="0" cellspacing="0" border="0">\n\
		<tr>\n\
			<td colspan="2" align="left"><img src="/data/static/images/'+portalName+'/logo-'+portalName+'-print.jpg" width="277" height="55" border="0"></td>\n\
			<td>&nbsp;</td>\n\
		</tr>\n\
		<tr>\n\
			<td>&nbsp;</td>\n\
			<td>\n'+docContent+'</td>\n\
			<td>&nbsp;</td>\n\
		</tr>\n\
		<tr>\n\
			<td colspan="3">&nbsp;</td>\n\
		</tr>\n\
	</table>\n\
</body>\n\
</html>');

	prWindow.document.close();
	prWindow.focus();
}

/*
Popup page by e-mail
*/
function emailPage(page) {
	page = page.replace('?','<questionmark>');
	popupWin = window.open('/forms/emailpage.html?url='+page, 'pass', 'scrollbars,width=460,height=580,resizable=no,status=yes');
}

/*
Popup contactform
*/
function contactPage() {
   popupWin = window.open('/forms/contact.html', 'pass', 'scrollbars,width=460,height=580,resizable=no,status=yes');
}

/*
Popup faq question form
*/
function faqQuestionPage(title) {
	title = title.replace("?","");
   popupWin = window.open('/forms/faqquestion.html?faqtitle='+encodeURI(title), 'pass', 'scrollbars,width=460,height=580,resizable=no,status=yes');
}

/*
Popup domain registration form
*/
function domeinPage() {
   popupWin = window.open('/forms/domeinregistratie.html?', 'pass', 'scrollbars,width=680,height=580,resizable=no,status=yes');
}

/*
detect from url which logo (IAE or BART) to be placed
*/
function WriteLogo() {
	var portalName = 'iae';
   //var match = window.location.href.match(/^http:\/\/portals(\.uk)?\.oce-bs\.(com|co\.uk)\/(.+)/);
   //var match = window.location.href.match(/^http:\/\/www\.claranet\.nl\/(.+)/);
   var match = window.location.href.match(/^http:\/\/clarasite\.vianetworks\.nl\/(.+)/);
	if ( match != null ) {
		tmpName = match[1].substr(0,match[1].indexOf('/'));
		if (tmpName != 'sitebox') {
			portalName = 'iae';
		}       
	}
	else {
		//developing site
		var match_via = window.location.href.match(/^http:\/\/iaesite\.(vianetworks)\.nl\/.*/);
		var match_iae = window.location.href.match(/^http:\/\/www.(iae).nl/);
		var match_bart = window.location.href.match(/^http:\/\/www\.(bart)\.nl\/.*/);
		//var match = window.location.href.match(/^http:\/\/([^.]+)(\.uk)?\.oce-bs\.(com|co\.uk)\/.*/);
		if ( match_via != null ) {
			portalName = 'iae';       
		}
		if ( match_iae != null ) {
			portalName = match_iae[1];       
		}
		if ( match_bart != null ) {
			portalName = match_bart[1];       
		}
	}
	logo_row = '<td colspan="2" align="left"><a href="/"><img src="/data/static/images/'+portalName+'/logo-'+portalName+'.jpg" width="300" height="55" border="0"/></a></td>';
	      

	document.write(logo_row);
} 

function WriteLogoPrint() {
	var portalName = 'iae';
   //var match = window.location.href.match(/^http:\/\/portals(\.uk)?\.oce-bs\.(com|co\.uk)\/(.+)/);
   //var match = window.location.href.match(/^http:\/\/www\.claranet\.nl\/(.+)/);
   var match = window.location.href.match(/^http:\/\/clarasite\.vianetworks\.nl\/(.+)/);
	if ( match != null ) {
		tmpName = match[1].substr(0,match[1].indexOf('/'));
		if (tmpName != 'sitebox') {
			portalName = 'iae';
		}       
	}
	else {
		//developing site
		var match_via = window.location.href.match(/^http:\/\/iaesite\.(vianetworks)\.nl\/.*/);
		var match_iae = window.location.href.match(/^http:\/\/www.(iae).nl/);
		var match_bart = window.location.href.match(/^http:\/\/www\.(bart)\.nl\/.*/);
		//var match = window.location.href.match(/^http:\/\/([^.]+)(\.uk)?\.oce-bs\.(com|co\.uk)\/.*/);
		if ( match_via != null ) {
			portalName = 'iae';       
		}
		if ( match_iae != null ) {
			portalName = match_iae[1];       
		}
		if ( match_bart != null ) {
			portalName = match_bart[1];       
		}
	}
	logo_row = '<td colspan="2" align="left"><a href="/"><img src="/data/static/images/'+portalName+'/logo-'+portalName+'-print.jpg" width="277" height="55" border="0"/></a></td>';
	      

	document.write(logo_row);
}

function WriteSubject() {
	var portalName = 'claranet';
   //var match = window.location.href.match(/^http:\/\/portals(\.uk)?\.oce-bs\.(com|co\.uk)\/(.+)/);
   var match = window.location.href.match(/^http:\/\/www\.claranet\.nl\/(.+)/);
   //var match = window.location.href.match(/^http:\/\/clarasite\.vianetworks\.nl\/(.+)/);
	if ( match != null ) {
		tmpName = match[1].substr(0,match[1].indexOf('/'));
		if (tmpName != 'sitebox') {
			portalName = 'IAE';
		}       
	}
	else {
		//developing site
		var match_via = window.location.href.match(/^http:\/\/iaesite\.(vianetworks)\.nl\/.*/);
		var match_iae = window.location.href.match(/^http:\/\/www.(iae).nl/);
		var match_bart = window.location.href.match(/^http:\/\/www\.(bart)\.nl\/.*/);
		//var match = window.location.href.match(/^http:\/\/([^.]+)(\.uk)?\.oce-bs\.(com|co\.uk)\/.*/);
		if ( match_via != null ) {
			portalName = 'IAE';       
		}
		if ( match_iae != null ) {
			portalName = 'IAE';       
		}
		if ( match_bart != null ) {
			portalName = 'bArt';       
		}
	}
	logo_subject = portalName;
	      

	document.write(logo_subject);
}  

