/**
*
*
* @CopyRight www.viscreation.de
*/
function login()
{
	JsHttpRequest.query("/events.php", {act: "login", frm: document.getElementById("frmLogin")}, function(req,text)
	{					
		
		if (req.Result == "OK" )
		{
			showUserDetails(req.Data);
			location.reload();
		}
		else
			alert("Nick or Pass erronius!");
	}, true)
	return false;
}


function logout()
{
	JsHttpRequest.query("/events.php", {act: "logout", frm: document.getElementById("frmLogin")}, function(req,text)
	{					
		document.getElementById("personInfo").style.display = "none";
		document.getElementById("LoginBox").style.display = "";
		location.href = "/ticketpoint/ru/koncerty/";
	}, true)
}

function showUserDetails(data)
{
	var obj;
	obj = document.getElementById("personInfo");
	obj.innerHTML = "Hello, <br><b>" + data.Firstname + " " + data.Name + "</b>!<br><br><a href=\"JavaScript:logout()\">Logout &raquo;</a>";
	obj.style.display = "";
	document.getElementById("LoginBox").style.display = "none";
}


function getGlobalCoord(e)
{
	var e;
	if (!e)	{
		document.MouseX = parseInt(event.clientX + document.body.scrollLeft);
		document.MouseY = parseInt(event.clientY + document.body.scrollTop);	
	} else {
		document.MouseX = parseInt(e.pageX);
		document.MouseY = parseInt(e.pageY);	
	}
	return ;
}



function showInfoText(html)
{
	var InfoTag = document.getElementById("InfoTag");
	var InfoContent = $("InfoContent")
	InfoContent.innerHTML = html;
	InfoTag.style.left 	= (document.MouseX) + "px";
	InfoTag.style.top 	= (document.MouseY + 20) + "px";	

	return false; 
}

function hideInfoText()
{
	document.getElementById("InfoContent").innerHTML = "";
	document.getElementById("InfoTag").style.top = "-1000px";
	document.getElementById("InfoTag").style.left = "-1000px";
	return false; 
}

function prepareBackgroundPNG()
{
	if (window.navigator.appName == undefined || window.navigator.appName != "Microsoft Internet Explorer" )
		return;
	
	var s1pix = "/Images/pix.gif"
	var obj = null;
	var sResult = "";

	for( var i = 0; i < document.all.length; i++)
	{
		obj = document.all[i];
		
		if ( obj.background && obj.background.match(/\.png$/) != null ) 
		{
			if ( obj.sizingMethod == undefined ) // crop, image, scale
				obj.sizingMethod = "crop"; 
			obj.style.background = "";
			obj.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + obj.background + "', sizingMethod='" + obj.sizingMethod +"');";
			obj.background = "";

		}
		if ( (obj.tagName == "IMG" || obj.tagName == "INPUT") && obj.src.match(/\.png$/) != null ) 
		{
			if ( obj.sizingMethod == undefined ) // crop, image, scale
				obj.sizingMethod = "scale"; 
			obj.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + obj.src + "', sizingMethod='" + obj.sizingMethod +"');";
			obj.src = s1pix;
		} 
	}
}


//document.onmousemove = getGlobalCoord;
window.onload = function()
{
	
	
	prepareBackgroundPNG();
//	document.getElementById("NavigationBlock").innerHTML = AC_FL_RunContent(
//			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
//			'width', '770',
//			'height', '221',
//			'src', '/Flash/navigation',
//			'quality', 'high',
//			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
//			'align', 'middle',
//			'play', 'true',
//			'loop', 'true',
//			'scale', 'showall',
//			'wmode', 'window',
//			'devicefont', 'false',
//			'id', 'navigation',
//			'bgcolor', '#E9E9E7',
//			'name', 'navigation',
//			'menu', 'true',
//			'allowFullScreen', 'false',
//			'allowScriptAccess','sameDomain',
//			'movie', '/Flash/navigation',
//			'salign', ''
//			);
	
}
