// CCA JavaScript         
//                        
// (c) 2004 Vasco Brattka 

function OpenPage() {
if((navigator.appName.indexOf("Netscape") >= 0)
       && (parseInt(navigator.appVersion) <= 4 ))
       document.write('<BODY BGCOLOR="#FFFFFF" LINK="#006699" ALINK="#FF9900"><CENTER><TABLE WIDTH="80%"><TR><TD><FONT SIZE="4">');
else   document.write('<BODY>');
}

function ClosePage() {
if((navigator.appName.indexOf("Netscape") >= 0)
       && (parseInt(navigator.appVersion) <= 4 ))   
       document.write('</FONT></TD></TR></TABLE></CENTER>');
}

function OpenFont(s) {
if((navigator.appName.indexOf("Netscape") >= 0)
       && (parseInt(navigator.appVersion) <= 4 ))
       document.write('<FONT SIZE="'+s+'">');
}

function CloseFont() {
if((navigator.appName.indexOf("Netscape") >= 0)
       && (parseInt(navigator.appVersion) <= 4 ))
       document.write('</FONT>');
}

function Replace() {
if(window.location.href.indexOf("http://www.informatik.fernuni-hagen.de/import/cca/") >=0)
   window.location.replace("http://cca-net.de");
}

function Head(s,t) {
document.write('<P CLASS="Head">');
if(s != "") document.write('<A HREF='+t+' ><IMG SRC='+s+' BORDER="0" ALIGN="LEFT" ALT="[Image]"></A>');
document.write('<A HREF="http://cca-net.de"><IMG SRC="http://cca-net.de/images/cca_net_2.gif" BORDER="0" ALT="CCA Net"></A><BR>');
document.write('</P>');
}

function Menue() {
document.write('<P CLASS="Menue">');
document.write('<A HREF="http://cca-net.de/">Start</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/intro.html">Introduction</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/members.php">Members</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/list.html">Mailling List</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/publications/bibliography.html">Bibliography</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/publications/">Publications</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/events.html">Events</A>&nbsp;|&nbsp;');
document.write('<A HREF="http://cca-net.de/links.html">Links</A>');
document.write('</P>');
}

function CopyRight(s) {
           var now = new Date();
           var year = now.getYear();
           if(year < 999) year+=1900;
           document.write('<P CLASS="SmallCenter">');
           if(year == s) document.write('&copy;&nbsp;&nbsp;'+year+' <A HREF="http://cca-net.de/vasco/">Vasco Brattka</A>'); 
           else          document.write('&copy;&nbsp;&nbsp;'+s+'-'+year+' <A HREF="http://cca-net.de/vasco/">Vasco Brattka</A>');
           document.write('</P>');
}

function CopyRightSimple(s) {
           var now = new Date();
           var year = now.getYear();
           if(year < 999) year+=1900;
           if(year == s) document.write('&copy;&nbsp;&nbsp;'+year+' Vasco Brattka'); 
           else          document.write('&copy;&nbsp;&nbsp;'+s+'-'+year+' Vasco Brattka');
}

function WriteYear() {
           var now = new Date();
           var year = now.getYear();
           if(year < 999) year+=1900;
           document.write(year); 
}

function WriteLastYear() {
           var now = new Date();
           var year = now.getYear()-1;
           if(year < 999) year+=1900;
           document.write(year); 
}

function Count() {
   var s="cca"+window.location.pathname;
   document.write('<IMG SRC="http://cca-net.de/cgi-bin/nph-count?width=6&amp;link='+s+'&amp;show=NO" ALT="">');
   document.write('<IMG SRC="http://cca-net.de/images/empty.gif" ALT="" Name="Count" onMouseDown="CountShow()" onMouseUp="CountHide()" onMouseOut="CountHide()">');
}

function CountShow() {
   var s="cca"+window.location.pathname;
   window.document.Count.src = "http://cca-net.de/cgi-bin/nph-count?width=6&link="+s+"&show=yes";
}

function CountHide() {
   window.document.Count.src = "http://cca-net.de/images/empty.gif";
}

function decode(s) {
         var now = new Date();
	 var n=0;
	 var r="";
	 for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i); 
		//if (n>=8364) {n = 128;}
		r += String.fromCharCode(n-3); 
	 }
	 return r;
}

function replacePIC(s) {
	 var n=0;
	 var r="";
	 for(var i=0;i<s.length;i++) { 
		n=s.charCodeAt(i);
//		if (n==64)        {r += '<IMG SRC="http://cca-net.de/images/a.gif" STYLE="border-style:none; vertical-align:bottom;">';}
//                else { if (n==46) {r += '<IMG SRC="http://cca-net.de/images/p.gif" STYLE="border-style:none;">';}
		if (n==64)        {r += '<IMG SRC="http://cca-net.de/images/a.gif" BORDER="0" VALIGN="BOTTOM">';}
                else { if (n==46) {r += '<IMG SRC="http://cca-net.de/images/p.gif" BORDER="0">';}
                       else       {r += String.fromCharCode(n);} 
	             } 
         }
	 return r;
}

function add(s) {
         var prime=String.fromCharCode(39);
         document.write('<A HREF="javascript:send('+prime+s+prime+');">'+decode(s)+'</A>');
}

function add2(s,t) {
         var prime=String.fromCharCode(39);
         document.write('<A HREF="javascript:send('+prime+s+t+prime+');">'+decode(s)+'</A>');
}

function addout(s,v) {
         var now = new Date();
         var year = now.getYear();
         if(year < 999) year+=1900;
         var prime=String.fromCharCode(39);
         if(year < v) document.write('<A HREF="javascript:send('+prime+s+prime+');">'+decode(s)+'</A>');
         else         document.write('[Email outdated]');   
}

function add2out(s,t,v) {
         var now = new Date();
         var year = now.getYear();
         if(year < 999) year+=1900;
         var prime=String.fromCharCode(39);
         if(year < v) document.write('<A HREF="javascript:send('+prime+s+t+prime+');">'+decode(s)+'</A>');
         else         document.write('[Email outdated]');   
}

function send(s)	{
        var r=decode(s);
        location.href="mailto:"+r;
        var n=r.indexOf("?");
        if(n==-1) {n=r.length;}
        window.clipboardData.setData("Text",r.substring(0,n));                                               
}

function adds(s) {
         var prime=String.fromCharCode(39);
         document.write('<SPAN CLASS="Calm"><A HREF="javascript:send('+prime+s+prime+');">'+replacePIC(decode(s))+'</A></SPAN>');
}

function add2s(s,t) {
         var prime=String.fromCharCode(39);
         document.write('<SPAN CLASS="Calm"><A HREF="javascript:send('+prime+s+t+prime+');">'+replacePIC(decode(s))+'</A></SPAN>');
}

function addform(s) {
         r=decode(s);
         var prime=String.fromCharCode(39);
         document.write('<FORM ACTION="mailto:'+r+'" METHOD=POST ENCTYPE="text/plain">');
}

