// Jeepee's CornuCopia javascript functions

function MeelVerzoek(type,rielneem,meelneem1,meelneem2) {
	var wUrl   = "";
	var wWidth = "450";
	var wHeight= "175";
	var wParms = "directories=no,status=no,toolbar=no,scrollbars=no,menubar=no";
	var wName  = "meelraam";
	var meel = "mailto: "+ meelneem1; 
	switch (type){
	   case "1" : 
		meel += "@co-" + "cornucopia.";
		meel +="org";
		break;
	   case "2" : 
		meel += "@co-" + "cornucopia.";
		meel +="org.uk";
		break;
	   case "3" : 
		meel += "@" + meelneem2;
		break;
	   default : 
		meel="";
		alert("E-mail address is wrong");
	}
	if (meel) {
	var wHTML  ="<html><head>";
	wHTML +="<SCRIPT language='JavaScript' TYPE='text/javascript'>";
	wHTML +="function CloseIt(form) {window.close()}; ";
	wHTML +="function ConfirmMail(form) {document.location.href=form.meeladders.value; CloseIt();}";
	wHTML +="</SCRIPT></head><body>";
	wHTML +="<table width='100%' border='0'><tr><td width='2%'>&nbsp;</td>";
	wHTML +="<td width='33%' align='center' valign='middle'> <div align='center'><img src='http://www.co-cornucopia.org.uk/images/cornlogo.gif' alt='CornuCopia Logo' width='138' height='140' align='absmiddle' /></div></td>";
	wHTML +="<td width='63%' align='center' valign='middle'> <h1>E-mail request </h1>";
	wHTML +="You have clicked to write an e-mail to <BR><B>"+rielneem+"</B><BR><BR>";
	wHTML +="<form> <input type='hidden' name='meeladders' value='" +meel+ "'>"; 
	wHTML +="<input type='button' name='Button1' value='Confirm' onClick='ConfirmMail(this.form)'> or ";
	wHTML +="<input type='button' name='Button2' value='Cancel' onClick='CloseIt(this.form)'></form></td>";
	wHTML +="<td width='2%'>&nbsp;</td></tr>";
	wHTML +="</table></body></html>";
	SPARK = new openCentredWindow(wUrl,wWidth,wHeight,wName,wParms,wHTML);
	}
}

function openHelpWindow(wUrl){
	var wWidth=500;
	var wHeight=300;
	var wName="HelpWindow";
	var wParms="status=no,toolbar=yes,scrollbars=yes,menubar=no";
	SPARK = new openCentredWindow(wUrl,wWidth,wHeight,wName,wParms);
}

function ExplainCCI() {
	var wUrl   = "";
	var wWidth = "350";
	var wHeight= "360";
	var wParms = "directories=no,status=no,toolbar=no,scrollbars=yes,menubar=no";
	var wName  = "CCIwindow";
	var wHTML  ="<html><head><title>Explanation CCI</title></HEAD>";
	wHTML +="<body>";
	wHTML +="<B>CCI</B> is short for 'Co-Counselling International'<BR><BR>";
	wHTML +="Co-Counselling International is a world-wide association of individuals and local networks committed to affirm a core discipline of co-counselling while encouraging - on an international and co-operative basis - the advancement of sound theory, effective practice and network development.<BR><BR>";
	wHTML +="Local networks of co-counsellors within CCI are independent, self-governing peer organisations, exploring ways of being effective social structures while avoiding authoritarian control.<BR><BR>";
	wHTML +="CCI was founded in the 1970's by Tom and Dency Sargent in the USA and John Heron in the UK.";
	wHTML +="</font></center></body></html>";
	SPARK = new openCentredWindow(wUrl,wWidth,wHeight,wName,wParms,wHTML);
} 

function ViewFeedbackForm() {
	var wUrl="http://www.co-cornucopia.org.uk/feedback.htm";
	var wWidth=500;
	var wHeight=400;
	var wName="FeedbackWindow";
	var wParms="status=no,toolbar=no,scrollbars=yes,menubar=no";
	SPARK = new openCentredWindow(wUrl,wWidth,wHeight,wName,wParms);
}

function ViewSupportUs() {
	var wUrl="http://www.co-cornucopia.org.uk/support-us.html";
	var wWidth=500;
	var wHeight=400;
	var wName="ViewSupportWindow";
	var wParms="status=no,toolbar=no,scrollbars=yes,menubar=no";
	SPARK = new openCentredWindow(wUrl,wWidth,wHeight,wName,wParms);
}

function openCentredWindow(wUrl,wWidth,wHeight,wName,wParms,wHTML) 
{	var left=Math.floor((screen.width - wWidth)/2);
	var top =Math.floor((screen.height - wHeight)/2);
	var winParms ="top="+top+",left="+left+",width="+wWidth+",height="+wHeight;
	if (wParms) {winParms +="," + wParms};
	var myWin=window.open(wUrl,wName,winParms);
	myWin.focus();
	if (wHTML) {myWin.document.write(wHTML)}; 
	return myWin;
}

function CloseIt() {
  close();
}

function DownloadPDF() {
	myWin=open('http://www.co-cornucopia.org.uk/acroload.htm','displayWindow','width=550,height=460,status=no,toolbar=yes, scrollbars=yes,menubar=no');
	// close the document - (not the window!)
	if (! myWin.closed) {myWin.document.close()}  
}

function openOverlappingWindow(UrlArt,UrlDisc) {
	var topspace =Math.floor(screen.height /10);
	var wheigth  =Math.floor(-topspace);
	top.window.parent.location.href=UrlArt;
	Vervolgens(UrlDisc);
}

function DiscussionOpen(discURL) {
	if (parent.Discussion){
		parent.Discussion.location.href=discURL;
		}
	else {
		Vervolgens(discURL);
	}
}

function Vervolgens(discURL){
	var topspace =Math.floor(screen.height /10);
	var wheigth  =(screen.availHeight - topspace);
	if (document.all) {
		top.window.parent.moveTo(0,topspace);
		top.window.parent.resizeTo(screen.availWidth,wheigth);
		}
	else if (document.layers||document.getElementById){ 
		top.resizeTo(screen.availWidth,wheigth);
		top.moveTo(0,topspace);
		}
	var leftspace=Math.floor(screen.width /14);
	var wwidth   =Math.floor(screen.width -leftspace-3);
	var wName="Discussion";
	var ParmsDisc="top=0,left=" +leftspace+ ",width=" +wwidth+ ",height="+screen.height+ ',toolbar=yes,scrollbars=yes,status=yes,menubar=yes';
	var myWinDisc=window.open(discURL,wName,ParmsDisc);
	myWinDisc.focus();
}

function noway() {
		alert('You cannot use the return key to send the message. Click the send button instead.');
		return false;
}