//***************************************
//        DESIGN BY LEBEDEV ANTON
//        http://www.lebedev.org
//        anton@lebedev.org
//        St.Petersburg, Russia
//        03/02/2003
//***************************************

//***************************************
//      Definition type browser
//***************************************

if (navigator.appName.indexOf('Microsoft')>=0)
    { var msie=true }
  else
    { var msie=false };

//***************************************
//      Pop up window
//***************************************

function openWin() {
  myWin= open("banner.html", "displayWindow", "width=502,height=245,status=no, resizable=no, toolbar=no,menubar=no");
}





//***************************************
//      Form
//***************************************





			txt = new Object();

			var cnt=-1;
			var strMesg="                             ";
			var strLen=strMesg.length;
			var counter=-1;
			var strObj;
			startHelp=0;
			textDelay=80;

			function helpText(strObj)
			{
				if(startHelp)
				{
					curObj=strObj;
					// strObj.focus();
					clearTimeout(cnt);
					strObj.value+=strMesg.charAt(counter);
					counter++;
					if (counter>strLen)
					{
						strObj.value='';
						startHelp=0;
						return;
					}
					cnt=setInterval("helpText(eval(curObj))",textDelay);
				};
			}

			function checkRequest( formName )
			{
				thisForm=document.forms[ formName ];
			txt.validateObj = thisForm.FirstName;
							if (txt.validateObj)
							{
								// FullName : Begin
								if (txt.validateObj.value.length < 2 || !isNaN(txt.validateObj.value))
								{
									strMesg="Enter your name...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									alert("clear!");
									helpText(txt.validateObj);
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
							}
							// FullName : End
			txt.validateObj = thisForm.LastName;
							if (txt.validateObj)
							{
								// FullName : Begin
								if (txt.validateObj.value.length < 2 || !isNaN(txt.validateObj.value))
								{
									strMesg="Enter your name...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									alert("clear!");
									helpText(txt.validateObj);
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2000);
									return (false);
								}
							}
							// FullName : End
			txt.validateObj = thisForm.__mailform_replyTo;
							if (txt.validateObj)
							{
								// EmailAddr : Begin
								if (txt.validateObj.value.length < 5)
								{
									strMesg="Enter your e-mail address...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}
								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								em=0;
								em=txt.validateObj.value.indexOf("@");
								if (em==-1)
								{
									strMesg="E-mail address incorrect...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								emp=0;
								emp=txt.validateObj.value.indexOf(".");

								if (emp==-1)
								{
									strMesg="E-mail address incorrect...";
									txt.validateObj.value="";
									startHelp=1;
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}

								if (txt.validateObj.value==String(strMesg))
								{
									txt.validateObj.value="";
									helpText(txt.validateObj)
									cnt=-1;
									counter=-1;
									setTimeout("txt.validateObj.focus()",2500);
									return (false);
								}
								// EmailAddr : End
							}
			

				return(true);
			}

			function FormFocus()
			{
			//	thisForm=document.forms['validateForm'];

			//	txt.validateNameObj = thisForm.validateName;
			//	txt.validateNameObj.focus();
			}

			function ResetForm()
			{
			//	thisForm=document.forms['validateForm'];

			//	txt.validateNameObj = thisForm.validateName;
			//	txt.validateTitleObj = thisForm.validateTitle;
			//	txt.validateCompanyObj = thisForm.validateCompany;
			//	txt.validateObj = thisForm.validateEmail;
			//	txt.validateRecordObj = thisForm.validateRecord;
			//	txt.validateMessageObj = thisForm.validateMessage;

			//	thisForm.reset();

			//	txt.validateNameObj.value="";
			//	txt.validateTitleObj.value="";
			//	txt.validateCompanyObj.value="";
			//	txt.validateRecordObj.options[0].selected=true;
			//	txt.validateObj.value="";
			//	txt.validateMessageObj.value="";
			}







var colors = new Array(	"#7b7b7b", "#7b7b7b" , "#ffffff");

//	Set the basic color
var basicColor = "#7b7b7b";

//	Set the global vars to their initial state
var curColIdx = 0;
var curElem;

var	mousePosX = 0;
var mousePosY = 0;

//	Set the glow speed
var speed = 1;

//	Initialize glower scripts
function init()
{
	//	ie only :p

	if (!document.layers)
	{
		document.onmouseover = determine_tag;
		document.onmouseout = end_glow;
		check_state();
	}
}

//	Stop the glowing of a link
function end_glow()
{
	if (curElem)
	{
		//	Reset values
		curElem.style.color = basicColor;
		curColIdx = 0;
		curElem = false;
	}
}

//	Stop the glowing of a link
function start_glow(ev)
{
		// If element does not exist, return
		if (!curElem) return;
		ev = curElem;

		//	determine which color is being used
		tempCol = ev.style.color;
		if (tempCol == basicColor)
		{
			//	Reset colorindex
			curColIdx = 0;
		}
		if (!tempCol)
		{
			//	Color not yet set, set index to 0
			curColIdx = 0;
			tempCol = basicColor;
		}
		else
		{
			// 	Search current color
			itemN = colors.length;
			for (f = 0; f < itemN; f++)
			{
				if (colors[f] == tempCol)
				{
					//	Color found, update counter
					if (f >= (itemN-1))
					{
						// Jump to first color
						curColIdx = 0;
					}
					else
					{
						//	Increase color index with one
						curColIdx = f + 1;
					}

				} // end if: check for color

			}//	end if: search color

		}//	end if: initiate search

		//	set color
		ev.style.color = colors[curColIdx];

}

function determine_tag()
{
	ev = window.event.srcElement;
	mousePosX = window.event.offsetX;
	mousePosY = window.event.offsetY;

	tag = ev.tagName;

	//	Respond to anchor tags only
	if (tag == "A")
	{
		if (curElem)
		{
			curElem = false;
			return;
		}
		curElem = ev;
	}
	else
	{
		curElem = false;
	}
}

function check_state()
{
	if (curElem)
	{
		start_glow();
	}

		//	Object is selected, glow
	if (!curElem) end_glow();//	Object is not selected, do not glow


	//	Set timer
	window.setTimeout("check_state()", speed);
}
