	var interval  = 5; // delay between rotating images (in seconds)
var interval2 = 10; // delay between rotating images (in seconds)
var interval3 = 5; // delay between rotating images (in seconds)
var random_display = 1; // 0 = no, 1 = yes
interval  *= 1000;
interval2 *= 1000;
interval3 *= 1000;
var image_index = 0;

image_list = new Array(); //Array of Banner Images 
image_list[image_index++] = new imageItem("images/banner_400_40_1.gif");
image_list[image_index++] = new imageItem("images/banner_400_40_2.gif");
image_list[image_index++] = new imageItem("images/banner_400_40_3.gif");
image_list[image_index++] = new imageItem("images/phantom.gif");
image_list[image_index++] = new imageItem("images/phantom1.gif");

var number_of_image = image_list.length;
function imageItem(image_location) {
this.image_item = new Image();
this.image_item.src = image_location;
}
function get_ImageItemLocation(imageObj) {
return(imageObj.image_item.src)
}
function generate(x, y) {
var range = y - x + 1;
return Math.floor(Math.random() * range) + x;
}
function getNextImage() {
if (random_display) {
image_index = generate(0, number_of_image-1);
}
else {
image_index = (image_index+1) % number_of_image;
}
var new_image = get_ImageItemLocation(image_list[image_index]);
return(new_image);
}
function call_func(){
rotateImage('rImage1');
var first = "rotateImage1('rImage2')";
setTimeout(first, 3000);
var second = "rotateImage2('rImage3')";
setTimeout(second, 6000);
}
function rotateImage(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call = "rotateImage('"+place+"')";
setTimeout(recur_call, interval);
}
function rotateImage1(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call1 = "rotateImage1('"+place+"')";
setTimeout(recur_call1, interval2);
}
function rotateImage2(place) {
var new_image = getNextImage();
document[place].src = new_image;
var recur_call1 = "rotateImage2('"+place+"')";
setTimeout(recur_call1, interval3);
}





//Function to check form is filled in correctly before submitting
function CheckForm () {

	//Check for a somthing to search for
	if (document.frmSearch.KW.value==""){

		msg = "_______________________________________________________________\n\n";
		msg += "The form has not been submitted because there are problem(s) with the form.\n";
		msg += "Please correct the problem(s) and re-submit the form.\n";
		msg += "_______________________________________________________________\n\n";
		msg += "The following field(s) need to be corrected: -\n";

		alert(msg + "\n\tSearch For\t- Enter something to search for\n\n");
		document.frmSearch.KW.focus();
		return false;
	}	
	
	frmSearch.Submit.disabled=true;

	return true;
}



/* V1.1.1: Er. Shailesh Setha (shailesh_setha@yahoo.com) */
//Check email address

function emailCheck (emailStr) {

/* The following variable tells the rest of the function whether or not
to verify that the address ends in a two-letter country or well-known
TLD.  1 means check it, 0 means don't. */

var checkTLD=1;

/* The following is the list of known TLDs that an e-mail address must end with. */

var knownDomsPat=/^(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum)$/;

/* The following pattern is used to check if the entered e-mail address
fits the user@domain format.  It also is used to separate the username
from the domain. */

var emailPat=/^(.+)@(.+)$/;

/* The following string represents the pattern for matching all special
characters.  We don't want to allow special characters in the address. 
These characters include ( ) < > @ , ; : \ " . [ ] */

var specialChars="\\(\\)><@,;:\\\\\\\"\\.\\[\\]";
var validChars="\[^\\s" + specialChars + "\]";

/* The following pattern applies if the "user" is a quoted string (in
which case, there are no rules about which characters are allowed
and which aren't; anything goes).  E.g. "shailesh setha"@hotmail.com
is a legal e-mail address. */

var quotedUser="(\"[^\"]*\")";

/* The following pattern applies for domains that are IP addresses,
rather than symbolic names.  E.g. shail@[123.124.125.4] is a legal
e-mail address. NOTE: The square brackets are required. */

var ipDomainPat=/^\[(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})\]$/;

/* The following string represents an atom (basically a series of non-special characters.) */

var atom=validChars + '+';

/* The following string represents one word in the typical username.
For example, in shailesh.setha@rediffmail.com, shailesh and setha are words.
Basically, a word is either an atom or quoted string. */

var word="(" + atom + "|" + quotedUser + ")";

// The following pattern describes the structure of the user

var userPat=new RegExp("^" + word + "(\\." + word + ")*$");

/* The following pattern describes the structure of a normal symbolic
domain, as opposed to ipDomainPat, shown above. */

var domainPat=new RegExp("^" + atom + "(\\." + atom +")*$");

/* Begin to break up user@domain into different pieces that are easy to analyze. */

var matchArray=emailStr.match(emailPat);

if (matchArray==null) {

/* Too many/few @'s or something; basically, this address doesn't
even fit the general mould of a valid e-mail address. */

alert("Email address seems incorrect (check @ and .'s)");
return false;
}
var user=matchArray[1];
var domain=matchArray[2];

// Start by checking that only basic ASCII characters are in the strings (0-127).

for (i=0; i<user.length; i++) {
if (user.charCodeAt(i)>127) {
alert("Ths username contains invalid characters.");
return false;
   }
}
for (i=0; i<domain.length; i++) {
if (domain.charCodeAt(i)>127) {
alert("Ths domain name contains invalid characters.");
return false;
   }
}
if (user.match(userPat)==null) {
alert("The username doesn't seem to be valid.");
return false;
}
var IPArray=domain.match(ipDomainPat);
if (IPArray!=null) {
	for (var i=1;i<=4;i++) {
		if (IPArray[i]>255) {
			alert("Destination IP address is invalid!");
			return false;
		   }
	}
return true;
}
 
var atomPat=new RegExp("^" + atom + "$");
var domArr=domain.split(".");
var len=domArr.length;
for (i=0;i<len;i++) {
if (domArr[i].search(atomPat)==-1) {
alert("The domain name does not seem to be valid.");
return false;
   }
}

/* domain name seems valid, but now make sure that it ends in a
known top-level domain (like com, edu, gov) or a two-letter word,
representing country (uk, nl), and that there's a hostname preceding 
the domain or country. */

if (checkTLD && domArr[domArr.length-1].length!=2 && 
domArr[domArr.length-1].search(knownDomsPat)==-1) {
alert("The address must end in a well-known domain or two letter " + "country.");
return false;
}

if (len<2) {
alert("This address is missing a hostname!");
return false;
}
return true;
}



/*
Allows only alphabates, numbers & other valid characters,removes other characters (see from following variable, 
add characters to this to remove).
*/

var mikExp = /[$\\@\\\#%\^\&\*\(\)\[\]\+\_\{\}\`\~\=\|]/;

function dodacheck(val) {
	var strPass = val.value;
	var strLength = strPass.length;
	var lchar = val.value.charAt((strLength) - 1);
	if(lchar.search(mikExp) != -1) {
		var tst = val.value.substring(0, (strLength) - 1);
		val.value = tst;
	   }
}

function doanothercheck(form) {
	if(form.value.length < 1) {
		alert("Please enter something.");
		return false;
	}
	if(form.value.search(mikExp) == -1) {
		return false;
	}
	else {
		alert("Sorry, but the following characters\n\r\n\r@ $ % ^ & * # ( ) [ ] \\ { + } ` ~ = | \n\r\n\rare not allowed!\n");
		form.select();
		form.focus();
		return false;
	}
	return false;
}



//Do not allows blank.
function checkblank(form) {
	if(form.value.length < 1) {
		alert("Please enter something.");
		form.select();
		form.focus();
		return false;
	}
}



//Check min six characters, leading & trailing spaces not allowed.
function checksix(form) {
	var icount=0;
	var var_len=form.value.length;

	//Remove leading space

	for (icount=0;icount<=var_len;icount++){
		if(form.value.charAt(0)==' '){
			form.value=form.value.substring(1,form.value.length);
		}
	}

	//Remove trailing space
	var_len=form.value.length;

	for (icount=0;icount<=var_len;icount++){
		if (form.value.charAt(form.value.length-1)==' '){
			form.value=form.value.substring(0,form.value.length-1);
		}
	}

	if(form.value.length < 6) {
		alert("It must contain at least six characters.");
		form.select();
		form.focus();
		return false;
	}
}


//Check Username min six characters, spaces not allowed.
function checkusername(form) {
	var minlength=6;

	//Remove all spaces

	function ignoreSpaces(string) {
		var temp = "";
		string = '' + string;
		splitstring = string.split(" ");
		for(i = 0; i < splitstring.length; i++){
			temp += splitstring[i];
		}
		return temp;
	}
	form.value=ignoreSpaces(form.value);

	if(form.value.length < minlength) {
		alert("Username must contain at least six characters.");
		form.select();
		form.focus();
		return false;
	}
}