getElementsByClassName = function ( c )
{
	//var h = document.getElementById('container');
	var h = document;
	var e = h.getElementsByTagName('*');
	var o = new Array();

	for (var a = 0; a < e.length; a++) {
		if (e.className == c) { o[o.length] = a; }
	}
	return o;
}

$ = function ( val )
{
	var result;
	result = document.getElementById(val);
	return result;
}


setImgRollOver = function (c, timg)
{
	var a = new Array();
	var a = document.getElementsByTagName('*');
	var tmp;
	
	for (b=1; b<=a.length - 1; b++) {

		if (a[b].className == c) {
			a[b].onmouseover = function(){
				if (this.src) this.src = this.src.replace(".jpg", timg);
				this.parentNode.onfocus = function() { this.blur(); }
			};
			a[b].onmouseout = function(){
				if (this.src) this.src = this.src.replace("_on", "");
			};
		}
	}
}

doprint = function ()
{
	toprint("HYDROPRESS", $("center_container").innerHTML);
}

toprint = function (title, content)
{

	NewWindow=window.open("", "","width=800,height=600,toolbar=no,directories=no,menubar=no,locations=no,status=no,scrollbars=yes,resizable=no,fullscreen=no");
	NewWindow.document.open();

	NewWindow.document.writeln("<html>\n<head>\n</head>");
	NewWindow.document.writeln("<body leftmargin=0 topmargin=0 scroll=yes style=\"background-color:#ffffff; font-family: verdana; font-size: 11px;\" onload=\"print();\">");
	NewWindow.document.writeln("<title>HYDROPRESS - "+ title +"</title>");
	NewWindow.document.writeln("<link rel=\"stylesheet\" type=\"text/css\" href=\"../templates/hydropress/style/style.css\">")
	NewWindow.document.writeln("<style>");
	NewWindow.document.writeln("img { border: none; } table { font-family: verdana; font-size: 11px; }");
	NewWindow.document.writeln("</style>");
	NewWindow.document.writeln("<table width=\"100%\"><tr><td>");
	NewWindow.document.writeln(content);
	NewWindow.document.writeln("</td></tr></table>");
	NewWindow.document.writeln("</body>\n</HTML>\n");
	NewWindow.document.close();
	NewWindow.focus();
}


window.onload = function ()
{
	setImgRollOver("menu", "_on.jpg");
	setImgRollOver("trans", "_on.jpg");
}

function flash(w, h, path)
{

	document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="'+w+'" height="'+h+'">'
	+'<param name="movie" value="'+path+'" />'
	+'<param name="quality" value="high" />'
	+'<param name="menu" value="0" />'
	+'<param name="wmode" value="transparent" />'
	+'<embed src="'+path+'" width="'+w+'" height="'+h+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" menu="0" wmode="transparent"></embed>'
	+'</object>');

}
function doSearch(lang)
{
	document.location.href = '/'+lang+'_search_'+$('query').value;
}

function handleEnter (field, event)
{
	var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
	if (keyCode == 13)
	{
		var i;
		for (i = 0; i < field.form.elements.length; i++)
			if (field == field.form.elements[i])
				break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
		return false;
	}
	else
		return true;
}

function showInfo(msg, val, w)
{
	var where = w;
	val++;
	document.getElementById('infoContainer').style.display = 'block';
	document.getElementById('infoMsg').innerHTML = msg;
	showCountdown(val, where);
}

function showCountdown(value, where)
{
	link = where;
	sec = value - 1;
	document.getElementById('infoCount').innerHTML = sec;
	if(sec != 0)
	{
		var down = window.setTimeout("showCountdown(sec, link)", 1000);
	}
	else
	{
		document.getElementById('infoContainer').style.display = 'none';
		document.location.href = link;
	}
}
