
statusY = 0;
statusX = 0;

if (document.location.href.indexOf('/rus/') != -1 ){
    var rus = true;
}

if (window.XMLHttpRequest)
{
	window.captureEvents(Event.MOUSEMOVE);
	window.onmousemove= displayCoords;
}	


function displayCoords(e) {
 	statusX = e.pageX;
 	statusY = e.pageY;
}

function set_id(id_name,str_name) {
   document.getElementById(id_name).innerHTML = str_name;}

function get_tagData(my_name){
   return my_name.firstChild.data;}

function writeURL(val)
{
	if (rus){
	    document.write("<a href=\"" + wwwUrl + "\" target=\"_blank\">далее...</a>");
	}
	else{
	    document.write("<a href=\"" + wwwUrl + "\" target=\"_blank\">see more...</a>");
    }
}

function displayHelp(dstatus)
{
	gId = "display-help";
	sId = "textbox-submit";
	help = "For searching for in categories:<br /><i>{text} + {name categories}</i>.<br />For searching for with use the operations 'OR':<br /><i>{text} or {text} ..</i>";
	if (dstatus == 1)
	{
		if (!window.XMLHttpRequest)
		{
			statusY = event.clientY;
			statusX = event.clientX;
		}
		document.getElementById(gId).style.display = "block";
	  document.getElementById(gId).style.top = statusY + 15;
		document.getElementById(gId).style.left = statusX + 15;
		set_id(gId,help);
	}
	else
	{
		document.getElementById(gId).style.display = "none";
	}		
}

function checkForm()
{
	if(document.form_textbox.keyword.value.length == 0)
	{
		alert('Error!\nWill enter word for searching!');
		return false;
	}
	else
	{
		return true;
	}
}