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) { 
	sPicURL = sPicURL.replace(/<p>/, '');
	sPicURL = sPicURL.replace(/<\/p>/, '');
	window.open("popup.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function PopupPic2(sPicURL) {
	sPicURL = sPicURL.replace(/<p>/, '');
	sPicURL = sPicURL.replace(/<\/p>/, '');
	window.open("popup5.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200,scrollbars=yes");
}

function PopupPic3(sPicURL) { 
	sPicURL = sPicURL.replace(/<p>/, '');
	sPicURL = sPicURL.replace(/<\/p>/, '');
	window.open("popup3.htm?"+sPicURL, "", "resizable=1,HEIGHT=400,WIDTH=400,scrollbars=no");
}

function PopupPic4(sPicURL) { 
	sPicURL = sPicURL.replace(/<p>/, '');
	sPicURL = sPicURL.replace(/<\/p>/, '');
	window.open("popup4.htm?"+sPicURL, "", "resizable=1,HEIGHT=200,WIDTH=200");
}

function PopupVideo(sPicURL) { 
	sPicURL = sPicURL.replace(/<p>/, '');
	sPicURL = sPicURL.replace(/<\/p>/, '');
	window.open("http://www.aristo.pl/popupvideo.htm?"+sPicURL, "", "resizable=1,HEIGHT=360,WIDTH=670,scrollbars=no");
}

function popup_powiadom(link) {
	/* zeby zachowac link w oryginalnej postaci trzeba zamienic & na cos innego
	*/
	if(link){
		okienko("powiadom.php?search=1&link=" + location.href.replace(location.search, '') + link.replace(/&/, '_amp_'), 380, 420, "pow");	
	}else{
		okienko("powiadom.php?link=" + location.href.replace(/&/, '_amp_'), 350, 340, "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 help_contakt(){
 	if(document.getElementById('serialno').value != '' && (document.getElementById('categoryNot').checked || document.getElementById('categoryNaw').checked)){
 		if(document.getElementById('categoryNot').checked){
 			document.getElementById('note_block').style.display = 'block';
 			document.getElementById('nawi_block').style.display = 'none';
 			$j.ajax({
	        	async: true,
			   	type: "POST",
			   	url: "/ocena.php",
			   	data: "work=serialno&kat=Notebooki&seria=" + $j("#serialno").val()
			 });
 		}else{
 			document.getElementById('nawi_block').style.display = 'block';
 			document.getElementById('note_block').style.display = 'none';
 			$j.ajax({
	        	async: true,
			   	type: "POST",
			   	url: "/ocena.php",
			   	data: "work=serialno&kat=Nawigacje&seria=" + $j("#serialno").val()
			 });
 		}
 	}else{
 		document.getElementById('serialno').value = 'Wpisz numer seryjny i wybierz kategorie!'
 	}
 }
 
 
function linkkod() {
 	if($j("#linkkod").attr("href") == '/koszyk.php?kod=')
 		$j("#linkkod").attr("href", $j("#linkkod").attr("href") + $j("#kod").val())
 }
 
function kodFocus() {
 	$j(this).val('');
 	$j(this).attr("href", "/koszyk.php?kod=")
 }
 
 function spr_mail(){
 	if(document.getElementById('ank_mail').value.length > 0){
 		var re = /^[a-zA-Z0-9_-]+(\.[a-zA-Z0-9_-]+)*@([a-zA-Z0-9_-]+)(\.[a-zA-Z0-9_]+)*(\.[a-zA-Z]{2,4})$/i;
		ele = document.getElementById('ank_mail').value;
		if(ele.match(re) == null){
			alert("Zły adres e-mail!\nSprawdĽ wprowadzone dane.");
			document.getElementById('ank_mail').focus();
			return false;
		}
 	}else{
 		alert("Proszę uzupełnić adres e-mail!");
		document.getElementById('ank_mail').focus();
 		return false;		
 	}
 	return true;	
 }
 
 function spr_rabat(){
 	if(spr_mail()){
 		if(!document.getElementById('ank_regulamin').checked){
 			alert("Wymagane jest zatwierdzenie regulaminu.");
 			return false;
 		}
 	}else{
 		return false;
 	}
 	return true;
 }
 
 function ank_view(wart, ele){
 	if(ele.name == 'ank_zadanie_wykonane'){
 		if(wart){
 			document.getElementById('zadanie_wykonane1').style.display = 'block';
 			document.getElementById('zadanie_wykonane2').style.display = 'block';
 		}else{
 			document.getElementById('zadanie_wykonane1').style.display = 'none';
 			document.getElementById('zadanie_wykonane2').style.display = 'none';
 		}
 	}else if(ele.name == 'sposob_rozwiazania_problemu[]'){
 		if(document.getElementById('rozwiazania_problemu1').checked || document.getElementById('rozwiazania_problemu2').checked){
 			document.getElementById('kontakt_techniczny1').style.display = 'block';
 			document.getElementById('kontakt_techniczny2').style.display = 'block';
 			document.getElementById('kontakt_techniczny3').style.display = 'block';
 			document.getElementById('kontakt_techniczny4').style.display = 'block';
 			document.getElementById('kontakt_techniczny5').style.display = 'block';
 			document.getElementById('kontakt_techniczny6').style.display = 'block';
 			document.getElementById('kontakt_techniczny7').style.display = 'block';
 			document.getElementById('kontakt_techniczny8').style.display = 'block';
 			document.getElementById('kontakt_techniczny9').style.display = 'block';
 			document.getElementById('kontakt_techniczny10').style.display = 'block';
 			document.getElementById('kontakt_techniczny11').style.display = 'block';
 			if(document.getElementById('kont_cheaked').checked){
 				document.getElementById('ile_rozmow1').style.display = 'block';
 				document.getElementById('ile_rozmow2').style.display = 'block';
 			}
 		}else{
 			document.getElementById('kontakt_techniczny1').style.display = 'none';
 			document.getElementById('kontakt_techniczny2').style.display = 'none';
 			document.getElementById('kontakt_techniczny3').style.display = 'none';
 			document.getElementById('kontakt_techniczny4').style.display = 'none';
 			document.getElementById('kontakt_techniczny5').style.display = 'none';
 			document.getElementById('kontakt_techniczny6').style.display = 'none';
 			document.getElementById('kontakt_techniczny7').style.display = 'none';
 			document.getElementById('kontakt_techniczny8').style.display = 'none';
 			document.getElementById('kontakt_techniczny9').style.display = 'none';
 			document.getElementById('kontakt_techniczny10').style.display = 'none';
 			document.getElementById('kontakt_techniczny11').style.display = 'none';
 			if(document.getElementById('kont_cheaked').checked){
 				document.getElementById('ile_rozmow1').style.display = 'none';
 				document.getElementById('ile_rozmow2').style.display = 'none';
 			}
 		}
 		
 	}else if(ele.name == 'ank_jeden_kontakt'){
 		if(wart){
 			document.getElementById('ile_rozmow1').style.display = 'block';
 			document.getElementById('ile_rozmow2').style.display = 'block';
 		}else{
 			document.getElementById('ile_rozmow1').style.display = 'none';
 			document.getElementById('ile_rozmow2').style.display = 'none';
 		}
 	}
 }
 
/*
 * 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 -->
