function mouse_over_td(obj,kol)
{
                obj.style.cursor = "pointer";
                obj.style.backgroundColor = kol;
}

function mouse_out_td(obj,kol)
{
                obj.style.cursor = "auto";
                obj.style.backgroundColor = kol;
}


function main_form_click(str,dzial,menu){
document.forms['main_form'].str.value=str;
document.forms['main_form'].dzial.value=dzial;
document.forms['main_form'].menu.value=menu;
document.forms['main_form'].submit();
}

function oblicz_transport(){
odl=Number(document.forms['main_form'].odleglosc1.value);
cena=0;
if (odl<20)
	cena=10;
else
if (odl<40)
	cena=20;
else
if (odl<60)
	cena=30;
else
if (odl<80)
	cena=40;
else
if (odl<100)
	cena=50;
else
if (odl<120)
	cena=60;
else
if (odl<150)
	cena=70;
else
if (odl<180)
	cena=80;
else
if (odl<210)
	cena=90;
else
if (odl<250)
	cena=100;
else
	cena=120;


document.forms['main_form'].cena_transport1.value=cena;
document.forms['main_form'].cena_suma_all1.value=cena+Number(document.forms['main_form'].cena_suma1.value);
}


function getScrollXY() {
  var scrOfX = 0, scrOfY = 0;
  if( typeof( window.pageYOffset ) == 'number' ) {
    //Netscape compliant
    scrOfY = window.pageYOffset;
    scrOfX = window.pageXOffset;
  } else if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) {
    //DOM compliant
    scrOfY = document.body.scrollTop;
    scrOfX = document.body.scrollLeft;
  } else if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) {
    //IE6 standards compliant mode
    scrOfY = document.documentElement.scrollTop;
    scrOfX = document.documentElement.scrollLeft;
  }
  return [ scrOfX, scrOfY ];
}

function getXYSize() {
  var myWidth = 0, myHeight = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
    myHeight = window.innerHeight;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
    myHeight = document.documentElement.clientHeight;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
    myHeight = document.body.clientHeight;
  }
  return [ myWidth, myHeight ];
}

function set_scroll()
{
pageoffset=getScrollXY();
document.forms['main_form'].yy.value=pageoffset[1];
}

function check_rej() {
tytul=false;
if (document.forms['main_form'].elements['tytul1'][0].checked)
tytul=true;
if (document.forms['main_form'].elements['tytul1'][1].checked)
tytul=true;

if (tytul==false)
	{
                alert("Bitte füllen Sie alle Felder aus");
                return false;	
	}	

tytul2=false;
if (document.forms['main_form'].elements['tytul2'][0].checked)
tytul2=true;
if (document.forms['main_form'].elements['tytul2'][1].checked)
tytul2=true;

if (tytul2==false)
	{
                alert("Bitte füllen Sie alle Felder aus");
                return false;	
	}	
	
if (document.forms['main_form'].elements['login1'].length<4)
	{
                alert("Benutzer ist unrichtig. Benutzer soll von 4 bis 10 Zeichen haben ohne deutsche Zeichen und ohne Sonderzeichen.");
                return false;	
	}	
if (document.forms['main_form'].elements['login1'].length>10)
	{
                alert("Benutzer ist unrichtig. Benutzer soll von 4 bis 10 Zeichen haben ohne deutsche Zeichen und ohne Sonderzeichen.");
                return false;	
	}	
if (document.forms['main_form'].elements['password1'].length<4)
	{
                alert("Kennwort ist unrichtig. Kennwort soll von 4 bis 10 Zeichen haben ohne deutsche Zeichen und ohne Sonderzeichen.");
                return false;	
	}	
if (document.forms['main_form'].elements['password1'].length>10)
	{
                alert("Kennwort ist unrichtig. Kennwort soll von 4 bis 10 Zeichen haben ohne deutsche Zeichen und ohne Sonderzeichen.");
                return false;	
	}	
if ((document.forms['main_form'].elements['login1'].value=='')||(document.forms['main_form'].elements['password1'].value=='')||(document.forms['main_form'].elements['nazwa1'].value=='')||(document.forms['main_form'].elements['adres1'].value=='')||(document.forms['main_form'].elements['kod1'].value=='')||(document.forms['main_form'].elements['miasto1'].value=='')||(document.forms['main_form'].elements['land1'].value=='')||(document.forms['main_form'].elements['telefon1'].value=='')||(document.forms['main_form'].elements['email1'].value=='')||(document.forms['main_form'].elements['osoba_podpisujaca1'].value=='')||(document.forms['main_form'].elements['nazwa_wysylki1'].value=='')||(document.forms['main_form'].elements['kod_wysylki1'].value=='')||(document.forms['main_form'].elements['adres_wysylki1'].value=='')||(document.forms['main_form'].elements['miasto_wysylki1'].value=='')||(document.forms['main_form'].elements['land_wysylki1'].value==''))
 {
                alert("Fehler! Sie müssen alle Pflichtfelder ausfüllen (alle mit*)");
                return false;
 }
if (!confirm('Achtung! Bitte prüfen Sie, ob alle Angaben für Ihre Rechnung korrekt sind.'))
     return false; 
 return true;
}


