var delay = 0;
var speed = 1;
var pause = 1;

var copyspeed = speed;
var pausespeed = (pause == 0)? copyspeed: 0;
var actualheight = '';

function scrollmarquee()
{
	if (parseInt(cross_marquee.style.top) > (actualheight*(- 1) + 8))
	{
		cross_marquee.style.top = parseInt(cross_marquee.style.top) - copyspeed + "px";
	}
	else
	{
		cross_marquee.style.top = parseInt(marqueeheight) + 8 + "px";
	}
};

function initializemarquee()
{
	cross_marquee = document.getElementById("marquee");
	cross_marquee.style.top = 270;
	marqueeheight = document.getElementById("marqueecontainer").offsetHeight;
	actualheight = cross_marquee.offsetHeight;
	
	if (window.opera || navigator.userAgent.indexOf("Netscape/7") != -1)
	{
		cross_marquee.style.height = marqueeheight + "px";
		cross_marquee.style.overflow = "scroll";
		return;
	}
	
	setTimeout('lefttime = setInterval("scrollmarquee()", 30)', delay);
};

if (window.addEventListener)
{
	window.addEventListener("load", initializemarquee, false);
}
else if (window.attachEvent)
{
	window.attachEvent("onload", initializemarquee);
}
else if (document.getElementById)
{
	window.onload = initializemarquee;
}

function ProcessSearchForm(form)
{
	if(!ValidateSearchForm_OnClick(form))
	{ 	
		return false;
	}
	else
	{
		return true;
	}
};

function ValidateSearchForm_OnClick(form)
{	
	var str = document.searchform.searchquery.value;
	
	if(str.length < 3 )
	{
		alert('Your query should consist of at least 3 characters.');
		return false;
	}
	
	return true;
};

function ProcessContactForm0(form)
{
	if(!ValidateContactForm0_OnClick(form))
	{ 	
		return false;
	}
	else
	{
		return true;
	}
};

function ValidateContactForm0_OnClick(form)
{	
	if((form.firstname.value == '')
	|| (form.email.value == '')
	|| (form.subject.value == '')
	|| (form.message.value == ''))
	{
		alert('Please verify that each specified field is filled out.');
		return false;
	}
	else if(!isValidEmail(form.email.value))
	{
		alert('The e-mail address you entered is not valid.');
		return false;
	}
	
	return true;
};

function ProcessContactForm1(form)
{
	if(!ValidateContactForm1_OnClick(form))
	{ 	
		return false;
	}
	else
	{
		return true;
	}
};

function ValidateContactForm1_OnClick(form)
{	
	if((form.firstname.value == '')
	|| (form.email.value == '')
	|| (form.subject.value == '')
	|| (form.title.value == '')
	|| (form.fulltitle.value == '')
	|| (form.abstract.value == ''))
	{
		alert('Please verify that each specified field is filled out.');
		return false;
	}
	else if(!isValidEmail(form.email.value))
	{
		alert('The e-mail address you entered is not valid.');
		return false;
	}
	
	return true;
};

function isValidEmail(str) 
{
   	return (str.indexOf(".") > 2) && (str.indexOf("@") > 0);
};
