function Full(file)
{
   window.open(file, "Pełny_obraz", "resizable=yes", "scrollbar=yes", "status=yes", "dependent=yes" )
}
function ShowHelp()
{
    help.style.visibility = "visible"
}
function HideHelp()
{
    help.style.visibility = "hidden"
}
function Search()
{
szybko.submit();
}
function SearchDeep()
{
szukaj.submit();
}

function PopUp(file)
{   
	okno = window.open(file,'Comes',"dependent,width=550,height=400,left=100,top=50,scrollbars=yes,resizable=yes");
	okno.close()
	okno = window.open(file,'Comes',"dependent,width=550,height=400,left=100,top=50,scrollbars=yes,resizable=yes");
	okno.ojciec=window.self
	if (window.focus) {
		okno.focus();
	}
}

function PopupPic(sPicURL) { 
	window.open("popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function PopupPic2(sPicURL) { 
	window.open("popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200,scrollbars=yes");
}

function popup_powiadom() {
	/* zeby zachowac link w oryginalnej postaci trzeba zamienic & na cos innego
	*/
	okienko("powiadom.php?link=" + location.href.replace(/&/, '_amp_'), 350, 300, "pow");
}


function okienko(file, dlug, wys, nazwa)
{   
	okno = window.open(file,nazwa,"dependent,width="+dlug+",height="+wys+",left=100,top=50,scrollbars=yes,resizable=yes");
	okno.ojciec=window.self
	if (window.focus) {
		okno.focus();
	}
}

function okienko_obr(file, dlug, wys, nazwa)
{   
	okno = window.open(file,nazwa,"dependent,width="+dlug+",height="+wys+",left=100,top=50,scrollbars=no,resizable=no");
	okno.ojciec=window.self
	if (window.focus) {
		okno.focus();
	}
}


function select_off(){	
	if(IE4){
		selecty = document.all.tags("select"); 
		for(var i = 0; i < selecty.length; i++){
			selecty[i].style.visibility = 'hidden';
		}
	}
}
function select_on(){
	if(IE4){
		selecty = document.all.tags("select");
		for(var i = 0; i < selecty.length; i++){
			selecty[i].style.visibility = 'visible';
		}
	}
}





  function MakeFiltr2(form_name, CondsArray) {
    if (typeof(CondsArray) == "undefined")
      CondsArray = [];
	  
//	  alert(document.forms[form_name].length);
	  
//	  for (i = 0; i<document.forms[form_name].length; i++)
//      	alert(document.forms[form_name][i].value+' --- '+i);
		  

    if ((document.forms[form_name]['s-11'].value) != "") {
      CondArray = [];
      CondArray[0] = 'pg';
      CondArray[1] = '==';
      CondArray[2] = document.forms[form_name]['s-11'].value;
      CondsArray[CondsArray.length] = CondArray;
    }

    if ((document.forms[form_name]['s-21'].value) != "%") {
      CondArray = [];
      CondArray[0] = 'p';
      CondArray[1] = '==';
      CondArray[2] = document.forms[form_name]['s-21'].value;
      CondsArray[CondsArray.length] = CondArray;
    }

   if ((document.forms[form_name]['s-31'].value)>0 && (document.forms[form_name]['s-32'].value)>0) {
      CondArray = [];
      CondArray[0] = 'cenab';
      CondArray[1] = '<=*<=';
      CondArray[2] = document.forms[form_name]['s-31'].value;
      CondArray[3] = document.forms[form_name]['s-32'].value;
      CondsArray[CondsArray.length] = CondArray;
   } else {
     if ((document.forms[form_name]['s-31'].value)>0) {
        CondArray = [];
        CondArray[0] = 'cenab';
        CondArray[1] = '>=';
        CondArray[2] = document.forms[form_name]['s-31'].value;
        CondsArray[CondsArray.length] = CondArray;
     }
     if ((document.forms[form_name]['s-32'].value)>0) {
        CondArray = [];
        CondArray[0] = 'cenab';
        CondArray[1] = '<=';
        CondArray[2] = document.forms[form_name]['s-32'].value;
        CondsArray[CondsArray.length] = CondArray;
     }
   }

   var i;
	  for (i = 11; i<document.forms[form_name].length; i+=3){
        CondArray = [];
		var j = (i+2);
		if(document.forms[form_name][i].value != 'ok'){
			if(document.forms[form_name][j].value != '%'){
		        CondArray[0] = document.forms[form_name][i].value;
	    	    CondArray[1] = 's';
		        CondArray[2] = document.forms[form_name][j].value;
		        CondsArray[CondsArray.length] = CondArray;
			}
		}
	  }



    window.location = CreateUrlConds('s', CondsArray);
  }


// ------ main stop ------------

 function check_isempty( id, deftxt ) {
    var o = document.getElementById(id);
	if (o.value != '' && o.value != deftxt && o.value != 'Wpisz coś') {
        return true;
	} else {
		o.value = 'Wpisz coś';
		return false;
	}
 }

 function main_search( id, deftxt, forma ) {
    if (check_isempty( id, deftxt )) {
        forma.submit();
        return true;
    }
 }

  function gotoconfig(model){
    url = "konfig.php?s-ktm="+model+"&m-ktm="+model+"&d=12";
    window.location = url;   
  }
  
/*
 * OCENA ARTYKULOW - POCZATEK
*/ 

$j("#oceniam a").live('click', function(){
	ref = $j(this).attr('rel');
	rating = $j(this).attr('class').substring(7);
	$j.ajax({
		async: true,
	   	type: "GET",
	   	url: "oceniam.php",
	   	data: {
	   		id:ref,
	   		w:rating
	   	},
	   	success: function( msg ){
	   		$j("#oceniam").html( '' );
	   		$j("#oceniam").html( msg );
	   	}
	});
	return false;
});

/*
 * OCENA ARTYKULOW - KONIEC
*/  

//Script hide end -->
