// Copyright 2004 by XIDEMIA http://www.xidemia.com/
function poczta(domain,user) {
locationstring = "mailto:" + user + "@" + domain;
window.location = locationstring;
}

function scrollWin(id){
$('html, body').animate({
scrollTop: $('#'+id).offset().top-124
}, 500);
return false;
}


function mmove(id, over) {
  if (!$('#'+id).css('backgroundPosition')) {
    $('#'+id).css({backgroundPosition: '0px 0px', top: '0px', left: '0px'});
  }


  if (over==1) {
		$('#'+id).animate({backgroundPosition:"(0px 20px)"}, 150, 'linear');
  } else {
		$('#'+id).animate({backgroundPosition:"(0px 0px)"}, 150, 'linear');
  }
}


function shar(id)
{
	if(document.getElementById("prodlisttl"+id).className=="pactive")
	{
		document.getElementById("prodlisttl"+id).className="norm";
	}
	else
	{
		document.getElementById("prodlisttl"+id).className="pactive";
	}

	if (document.getElementById('prodlist'+id).style.display == 'none')
	{
		document.getElementById('prodlist'+id).style.display = 'block';
	}
	else
	{
		document.getElementById('prodlist'+id).style.display = 'none';
	}

}
function sh2(t, id_name,page,lang,loading)
{
	sh(id_name,page,lang,loading);
	return false;
}
function sh(id_name,page,lang,loading)
{
	if (document.getElementById("li"+id_name))
	{
		if(document.getElementById("li"+id_name).className=="pactive")
		{
			document.getElementById("li"+id_name).className="norm";
			document.getElementById("lia"+id_name).style.display = 'none';
		}
		else
		{
			var id_pname=document.getElementById("shval").value;
			if (id_pname>0)
			{
				document.getElementById("li"+id_pname).className="norm";
				document.getElementById("lia"+id_pname).style.display = 'none';
			}
			document.getElementById("prod"+id_name).innerHTML=loading;
			makeRequest('WebForm1.aspx?page='+page+'&ln='+lang+'&id='+id_name+'&sid='+Math.random());
			document.getElementById("li"+id_name).className="pactive";
			document.getElementById("lia"+id_name).style.display = 'block';
			document.getElementById("shval").value=id_name;
		}
	}
}


// AJAX functions

            var http_request = false;

            function makeRequest(url) {

                http_request = false;

                if (window.XMLHttpRequest) { // Mozilla, Safari,...
                    http_request = new XMLHttpRequest();
                    if (http_request.overrideMimeType) {
                        http_request.overrideMimeType('text/xml');
                    }
                } else if (window.ActiveXObject) { // IE
                    try {
                        http_request = new ActiveXObject("Msxml2.XMLHTTP");
                    } catch (e) {
                        try {
                        http_request = new ActiveXObject("Microsoft.XMLHTTP");
                        } catch (e) {}
                    }
                }

                if (!http_request) {
                    alert('Giving up :( Cannot create an XMLHTTP instance');
                    return false;
                }
                http_request.onreadystatechange = GetContents;
				//document.getElementById("desc1").innerHTML=url;
                http_request.open('GET', url, true);
                http_request.send(null);

            }

            function GetContents() {

                if (http_request.readyState == 4) {
                    if (http_request.status == 200) {
                        var xmldoc = http_request.responseXML;
						var id = xmldoc.getElementsByTagName('id')[0].firstChild.nodeValue;
						var desc = xmldoc.getElementsByTagName('desc')[0].firstChild.nodeValue;
						var prod = xmldoc.getElementsByTagName('imgs')[0].firstChild.nodeValue;
						var prodone = xmldoc.getElementsByTagName('img')[0].firstChild.nodeValue;
						var linki = xmldoc.getElementsByTagName('linki')[0].firstChild.nodeValue;
						document.getElementById("desc"+id).innerHTML=desc;
						document.getElementById("prod"+id).innerHTML=prod;
						document.getElementById("prodone"+id).innerHTML=prodone;
						if (desc.length==0)	{
							document.getElementById("desc"+id).style.display='none';
							document.getElementById("prod"+id).style.paddingTop=0;
						}
						if (linki.length>0)	{
							document.getElementById("linki"+id).style.display='';
							document.getElementById("linki"+id).innerHTML=linki;
						}
                    } 
                }

            }


