var W=window,D=document
function Ob(id){return D.getElementById?D.getElementById(id):D.all?D.all[id]:null}
function trim(s){return s.replace(/^\s*|\s*$/g,'')}
function addLoadEvent(f){if(D.getElementById&&D.createTextNode){var old=W.onload;if(typeof W.onload!='function'){W.onload=f;}else{W.onload=function(){old();f()}}}}

function spr_mail(mail){var re=/^[\w-\.]+\@[\w\.-]+\.[a-z]{2,4}$/;return re.test(mail)}
function newsletter(f){if(!spr_mail(f.mail.value)){alert('Proszę podać prawidłowy adres e-mail');f.mail.focus();return false}return true}
function szukaj(f){if(trim(f.co.value).length<2){alert('Proszę wpisać przynajmniej dwa znaki');f.co.focus();return false}return true}
function wyszukaj(f){if(szukaj(f)){if(f.ki.selectedIndex==0){alert('Proszę wybrać kategorię');f.ki.focus();return false}return true}else return false}
function oferta_klik(e){var w,h=e.href,s=W.screen;if(s){h+='?screen='+s.width+'x'+s.height}w=W.open(h,'_blank');w.focus();return false}

function css() {
	if($.browser.msie){
		$('input[@type="password"], input[@type="text"], textarea, a').focus(function(){ $(this).addClass('focus'); });
		$('input[@type="password"], input[@type="text"], textarea, a').blur(function(){ $(this).removeClass('focus'); });
	}
	if($('ol').is('#outter-wrapper') == true){
		$('.item-wrapper>a.item-wrapper').click(function(){
			$('.item-wrapper.active-wrapper').removeClass('active-wrapper');
			$(this).parent('li').addClass('active-wrapper');
		});
	}
	
	var descheight = $("#prod-desc").height();
	if ( descheight > 110 ) { 
				$("#prod-desc").height("110px");
				$("#prod-desc").show();
				$("#prod-desc").next("p").show();
			}
	else    { 
				$("#prod-desc").show();
			}

	$("#prod-desc").next("p").children("span").click(function()
			{
				$(this).parent("p").prev("#prod-desc").toggleClass("rozwiniety");
				$(this).hide("");
				$("#prod-desc").next("p").children("span").not(this).show("");
			}
			);
	
	$('span.call ').hover(function(){ 
		var $dymek = $(this).next('.call-info').children('.attr-info');
		$dymek.css({ display: 'block'});
	}, 
	function(){
		var $dymek = $(this).next('.call-info').children('.attr-info');
		$dymek.css({ display: 'none'});
		return false;
	});
	
}
$(document).ready(css);