
function filterCategory() {
	var cat = get( 'kategoria' ).value;
	if( cat == 'all' ) {
		document.location.href = '/produkty/';
	} else {
		document.location.href = '/produkty/Kategoria-Produktow/'+cat;
	}
}

function saveNewPassword() {
	var op = get( 'old_pass' ).value;
	var np = get( 'new_pass' ).value;
	var npr = get( 'new_pass_repeat' ).value;
	var ajax = new myAjax();
	ajax.action = 'saveNewPassword';
	ajax.post( 'op='+op+'&np='+np+'&npr='+npr );
	ajax.onLoad = function() {
		var d = get( 'passwordMessage' );
		switch( this.response ) {
			case 'ok':
				putHtml( d, 'Zapisano nowe hasło' );
				break;
			case 'not_empty':
				putHtml( d, 'Hasło nie może być puste' );
				break;
			case 'bad_compare':
				putHtml( d, 'Hasło nie zgadza się z powtórzeniem hasła' );
				break;
			case 'bad_pass':
				putHtml( d, 'Stare hasło jest nieprawidłowe' );
				break;
			default:
				putHtml( d, this.response );
				break;
		}
	}
}

function sifr_replace() {
	if(typeof sIFR == "function"){
		sIFR.replaceElement(named({ sSelector:"div#login_panel div.sifr_l_ht", sFlashSrc:"/swf/sifr_century_gothic.swf", sColor:"#ffffff", sLinkColor:"#ffffff", sHoverColor:"#ffffff", sBgColor:'transparent', sWmode:'transparent' }));
	}
}

function searcher( target ) {
	get( target ).value = trim( getValue( target ) );
	var t = getValue( target );
	t = t.split( ' ' ).join( '+' );
	if( t.length < 3 ) {
		alert( 'Wyszukiwany tekst musi mieć conajmniej 3 znaki' );
	} else {
		document.location = '/szukaj/'+t;//+'/kategoria/'+o;
	}
}

/*
function publicLogin() {
	var l 	= getValue( 'public_login' );
	var p	= getValue( 'public_password' );
	get( 'loginMessage' ).value = '';
	var ajax = new myAjax();
	var pstr = 'login='+l+'&pass='+p+'&cn=Client';
	ajax.action = 'publicLogin';
	ajax.post ( pstr, 'loginMessage' );
	ajax.onLoad = function() {
		if( this.response == 'ok' ) {
			document.location.reload();
		}
	}
}
*/
function showDesc(divId){
	document.getElementById(divId).style.display = "block";
}

function hideDesc(divId){
	document.getElementById(divId).style.display = "none";
}

function showDescLong(divId){
	document.getElementById(divId).style.display = "block";
	$(".wide-col").css("height","870px");

}

function hideDescLong(divId){
	document.getElementById(divId).style.display = "none";
	$(".wide-col").css("height","700px");
}

function showDescMiddle(divId){
	document.getElementById(divId).style.display = "block";
	$(".wide-col").css("height","780px");

}

function hideDescMiddle(divId){
	document.getElementById(divId).style.display = "none";
	$(".wide-col").css("height","700px");
}

function flashTracker(str){
	
	if(str!='/dla-dzieci'){
		str='/dla-dzieci'+str;
	}

	pageTracker._trackPageview(str); 
}
