//-------------------------------------------------------------
// Written by Philippe TRAPIER - Copyright Business Force Ltd 2000
//
//-------------------------------------------------------------
//-------------------------------------------------------------
// doPopup
//---------
function OpenWin(URL_s, WIDTH, HEIGHT, closetime) {
windowprops = "left=10,top=10,width=" + WIDTH + ",height=" + HEIGHT;
preview = window.open(URL_s, "news", windowprops);
if (closetime) setTimeout("preview.close();", closetime*1000);
}
function doPopup(url, width, height) {
closetime = 0; // Close window after __ number of seconds?
// 0 = do not close, anything else = number of seconds
OpenWin(url, width, height, closetime);
}
//-------------------------------------------------------------
//-------------------------------------------------------------
// Activate Cloaking Device
//---------
function bustOut()
{
if (parent.frames.length!=0)
window.top.location.href="http://www.b-f.co.uk";
// OnLoad="bustOut()"
}
//-------------------------------------------------------------
//-------------------------------------------------------------
// Stop source viewing
//--------------------
function click() {
if (event.button==2) {
alert('Click OK to carry on...');
}
}
//-------------------------------------------------------------
//-------------------------------------------------------------
// Display local time
//-------------------
var user_msg = "TODAY";
function RunningTime() {
var printIt;
var RightNow = new Date()
var yr = RightNow.getFullYear()
if (RightNow.getMonth() < 9 )
{ var mm = '0' + (RightNow.getMonth() + 1) }
else
{ var mm = RightNow.getMonth() + 1 }
if (RightNow.getDate() < 10 )
{ var dd = '0' + RightNow.getDate() }
else
{ var dd = RightNow.getDate() }
if (RightNow.getHours() < 10 )
{ var hr = '0' + RightNow.getHours() }
else
{ var hr = RightNow.getHours() }
if (RightNow.getMinutes() < 10 )
{ var min = '0' + RightNow.getMinutes() }
else
{ var min = RightNow.getMinutes() }
if ( user_msg == "TODAY")
printIt = "GMT " +yr+ "/" +mm+ "/" +dd+ " " +hr+ ":" +min
else
printIt = user_msg + " GMT " +yr+ "/" +mm+ "/" +dd+ " " +hr+ ":" +min
document.clock.clockface.value = printIt
var KeepItGoing = setTimeout("RunningTime()","1000")
}
//-------------------------------------------------------------
//-------------------------------------------------------------
// Validate Email address
//----------------------- see recruiment/info_1.htm
function valid_email(address)
{
if (address.indexOf("@") == -1 || address.indexOf(".") == -1)
{ alert("Email addresses must contain one @ symbol and at least one dot");
return false;
}
var checkOK = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz'0123456789_-.@";
var checkStr = address;
var allValid = true;
if (checkStr.length <= 2)
{ alert("Email addresses is too short");
return false;
}
for (i = 0; i < checkStr.length; i++)
{ ch = checkStr.charAt(i);
if (checkOK.indexOf(ch) == -1)
{ alert("Please enter only letter, digit and \\\"_-'.@\\\" characters in this email field.");
return(false);
}
}
return(true);
}
function create_form_check(theform) {
if (theform.emailaddress.value == "")
{ alert("Please enter a value for the Email Address field.");
theform.emailaddress.focus();
return (false);
}
if (!valid_email(theform.emailaddress.value))
{ theform.emailaddress.focus();
return (false);
}
return true;
}
function login_form_check(theform) {
if (theform.emailaddress.value == "")
{ alert("Please enter a value for the Email Address field.");
theform.emailaddress.focus();
return (false);
}
if (!valid_email(theform.emailaddress.value))
{ theform.emailaddress.focus();
return (false);
}
if (theform.password.value == "")
{ alert("Please enter a value for the Password field.");
theform.password.focus();
return (false);
}
return true;
}
//-------------------------------------------------------------
//-------------------------------------------------------------
// Banner advertising
//---------
a = 4 // a=numbers of banners
var slump = Math.random();
var talet = Math.round(slump * (a-1))+1;
function create() {
this.code = ''
}
b = new Array()
for(var i=1; i<=a; i++) { b[i] = new create() }
b[1].code = '
'
b[2].code = '
'
b[3].code = '
'
b[4].code = '
'
var visa = "";
visa += ' '+b[talet].code+' '
//-------------------------------------------------------------
//-------------------------------------------------------------