function roll(img_name1, img_src1, img_name2, img_src2,img_name3, img_src3,img_name4, img_src4)
   {
   document[img_name1].src = img_src1;
   document[img_name2].src = img_src2;
   document[img_name3].src = img_src3;
   document[img_name4].src = img_src4;
   }


window.onload =
		function()
		{
                    if(document.getElementById('carousel')){
			$('#carousel').Carousel(
				{
					itemWidth: 110,
					itemHeight: 62,
					itemMinWidth: 50,
					items: 'a',
					reflections: .3,
					rotationSpeed: 1.8
				}
			);
			$.ImageBox.init(
				{
					loaderSRC: 'gfx/img/imagebox/loading.gif',
					closeHTML: '<img src="gfx/img/imagebox/close.jpg" />'
				}
			);
document.getElementById('loading_carousel').style.display = 'none';
document.getElementById('carousel').style.display = 'block';
                    }};

function upload_plikow(){
    var file = document.getElementById('realfilepc').value;

    var string=file.split('\\fakepath\\');
    if(string[1]==undefined){
        document.getElementById('fakefilepc').value=file;
    }else{
        document.getElementById('fakefilepc').value=string[1];
    }
}

    function handleEnter(e)
{
	var characterCode;
	if(e && e.which)
	{
		e = e;
		characterCode = e.which;
	}
	else
	{
		e = event;
		characterCode = e.keyCode;
	}

	if(characterCode == 13)
	{
		document.forms['logowanie_formularz'].submit();
                return false;
	}
	else
	{
		return true;
	}
}

function zliczaj_znaki()
{
    if(document.shoutbox_f.wiadomosc.value.length<71)
   {
       a=document.shoutbox_f.wiadomosc.value.length;
       b=70;
       c=b-a;
       divd = document.getElementById("sh_licznik");
       divd.innerHTML=c;
    }
    else
    {
       divvv = document.shoutbox_f.wiadomosc.value;
       document.shoutbox_f.wiadomosc.value= divvv.substr(0,70);
       divd.innerHTML=0;
       alert('Przekroczono dozwoloną ilość znaków [70]!');
    }
}

function GetXmlHttpObject()
{
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  return new XMLHttpRequest();
  }
if (window.ActiveXObject)
  {
  // code for IE6, IE5
  return new ActiveXObject("Microsoft.XMLHTTP");
  }
return null;
}
