/* AUTHOR: Cooking2000 (http://www.france.cooking2000.com) */
/* English Top Header : ETHeader.JS... */
/* CREATION DATE: 06/01/13 -- YY/MM/DD */
/* REVISION DATE: 06/01/13 -- YY/MM/DD */

function topheader(mymessage, mycolor) {

var myurltotest = location.href;
myurltotest = myurltotest.toUpperCase();
var d=document;
if (myurltotest.match("FORTUNECITY.COM") == null && myurltotest.match("FREE.FR") == null)
{
if (mymessage.substr(0, 2) == "XX")
	{ /* New, we now manage a mandatory message: it can NOT be randomized... */
	mytopmsg = mymessage.substr(2);
	}
else
	{
			/* This is the default message from Cooking2000 */
			var how_many_ads = 10;
			var now = new Date()
			var sec = now.getSeconds()
			var ad = sec % how_many_ads;
			ad +=1;
			if (ad>=7)
				{
				mytopmsg = '<a href="http://www.cooking2000.com/">Visit the original Cooking2000.com</a>';
				mycolor = "cafedeca"; /* This is the original color */
				if (ad>=9)
					{
					mytopmsg = '<a href="http://www.cooking2000.com/">Visit the original Cooking2000.com</a>';
					}
				}
			else
				{
				mytopmsg = mymessage;
				}
	}
}
else
	{
	/* This is the message for FREE.FR or FORTUNECITY.COM */
	if (mymessage.substr(0, 2) == "XX")
		{ /* New, we now manage a mandatory message: it can NOT be randomized... */
		mytopmsg = mymessage.substr(2);
		}
	else
		{
		VarNewAddress = 'Please use our new URL: <b><a href="http://www.cooking2000.com/">www.cooking2000.com</a></b>';
		mytopmsg = VarNewAddress; /* mytopmsg is changed to VarNewAddress */
		mycolor = "RED";          /* The default color is changed to RED */
		}
	}
d.write('<table width="100%" border="0" align="center" bgcolor="' + mycolor+ '">');
d.write('<tr>');
d.write('<td width="100%"><div align="center"><FONT FACE="Verdana"><b>' + mytopmsg + '</FONT></div></td>');
d.write('</tr></table>');

}