//SCRIPT FILE CONTAINING JAVASCRIPT FUNCTIONS (c) Martin Wolff 2007

// This is the function that will open the
// new window when the mouse is moved over the link
function open_new_window() 
{
new_window = open("","","width=420,height=520,left=100,top=50");

// open new document 
//new_window.document.open('#','','width=450,height=550');

// Text of the new document
// Replace your " with ' or \" or your document.write statements will fail
new_window.document.write("<html><title>Party!</title>");
new_window.document.write("<body bgcolor=\"#FFFFFF\">");
new_window.document.write("<img src='images/party1970s.jpg' width='400' height='500' alt='' border='1'>");
new_window.document.write("<br>");
new_window.document.write("</body></html>");

// close the document
new_window.document.close(); 
}

// This is the function that will close the
// new window when the mouse is moved off the link
function close_window() 
{
new_window.close();
}

function add_days(start,days)
// start is date in form "dd/mm/yy"
{						

m_year	= start.substring(6,8);	
m_month	= start.substr(3,5);
m_day	= start.substr(0,2);
var y1	= parseInt(m_year,10); 
var m1	= parseInt(m_month,10)-1;
var d1	= parseInt(m_day,10);
datevar	= Date(y1,m1,d1);	
datevar.setDate(datevar.getDate()+7);

document.write(datevar+'<br>');
}

function mailit(first,second,subject)
// send parts of a mailto link to this function to hide it from spammers
{
if (subject != "")
	{
	subject = "?subject="+subject
	}
document.write('<a href=\"mailto:'+first+'@'+second+subject+'\">'+first+'@'+second+'</a>' )
}

function telit(area,code)
{
code=area+" "+code;
document.write(code);
}

function nblocktop(ndate,author)
{
document.write('<div  align="left" style="font-family:courier new; font-size:10pt">');
document.write('<span style="color:Black"><b>Date:</b>'+ndate+'</span><br>');
document.write('<span style="color:Black"><b>From:</b>'+author+'</span><br>');
document.write('<span style="color:Black"><b>Message:</b></span><br>')
}
function nblockbot()
{
document.write('<div align="center" style="color:red; font-size:8pt">')
document.write('<form action="#top"><input type=submit value="Back to top" style="background:Lime;color:Black;font-size:8pt"></form></div>');
}
function imageWindow()
   {
   imageWindow = open('', '','scrollbars=no,resizable=no') 
   imageWindow.document.write("Picture this");
   }

function hw20Window(winfile)
    {
    window.open(winfile, '','scrollbars=no,resizable=yes,width=470,height=450')
    }
function openWindow(winfile)
   {
   window.open(winfile, '','scrollbars=yes,resizable=yes,width=550,height=255')
   }
function genWindow(winfile,gwidth,gheight)
   {
   window.open(winfile, '','scrollbars=yes,resizable=yes,width='+gwidth+',height='+gheight)
   }
function bigWindow(winfile)
   {
   window.open(winfile, '','scrollbars=yes,resizable=yes,width=690,height=620')
   }	
function roosterWindow(winfile)
   {
   window.open(winfile, '','scrollbars=yes,resizable=yes,width=550,height=600')
   }
function closeWindow() 
{
window.close();
}
function myclosebutton(cColor)
{
document.writeln("<input style='font-size:10px;color:White;background:"+cColor+";font-weight:bold' type='button' value=' CLOSE ' onclick='window.close()'>");
}
function bigclosebutton(cColor)
{
document.writeln("<input style='font-size:14px;color:White;background:"+cColor+";font-weight:bold' type='button' value=' CLOSE ' onclick='window.close()'>");
}

function welcomeWindow()
	{
	window.open('kahello.html','','scrollbars=yes,resizable=yes,width=330,height=385')
	}


function greeting()
{
  date = new Date();
   hourofday = date.getHours();
   if(hourofday >=0 && hourofday <=11)
     document.write('good morning,');
   if(hourofday >=12 && hourofday <= 17)
     document.write('good afternoon,');
   if(hourofday >=18 && hourofday <= 23)
     document.write('good evening,');
}


function announce()
{
document.writeln('<div align="center" style=" font-family:arial; font-size:9pt; color:#005000;">');
document.writeln('<hr color="#00a000">');
document.writeln('</div>');

}

function datetoday()
{
now = new Date();
mth = now.getMonth()+1;
mth = ((mth<10) ? "0":"")+mth ;
yr  = now.getYear();
day = now.getDate();
day = ((day<10) ? "0":"")+day ;
timeout = (yr+""+mth+""+day);
datetoday=day+"/"+mth+"/"+yr;
document.writeln(""+day+"/"+mth+"/"+yr+"")
}
function yeartoday()
{
now = new Date();
yr  = now.getYear();
yeartoday = yr;
document.write(yr);
}
function rtclickcheck(keyp)
{ 
if (navigator.appName == "Netscape" && keyp.which == 3)
{ 	alert(message); return false; 
} 
if (navigator.appVersion.indexOf("MSIE") != -1 && event.button == 2) 
{ 	alert(message); 	return false;
} 
