var menu_def="roz", is_tnyint=0;
var cur_cat='wsy';
var ovr_cat='';
var rol_cat='';

var shwcarts=1;	

var cur_mieacpl=-1;
var cur_uliacpl=-1;

var cur_panel_menu='';
var old_panel_menu='';


	function generate_code(g_qty_deals,g_width,g_height,g_id_city,g_city_name,g_qty_deals) {
		g_qty_deals = g_qty_deals - 1;
		var string_script  = '';
			string_script  = '<script type="text/javascript" src="http://www.dorwijokazje.pl/widget/widget.js">{';
		    string_script += '"width":"'+g_width+'px",';
		    string_script += '"maxheight":'+g_height+',';  
		    string_script += '"id_city":'+g_id_city+',';
		    string_script += '"city_name":"'+g_city_name+'",';
		    string_script += '"qtydeals":'+g_qty_deals+',';
		    string_script += '"qtycomp":'+g_qty_deals+',';
		    string_script += '}</script>';
	
		document.getElementById('widget_copycode').value = string_script;
	}

	function force_mouseout_menu(id) {
	  	old_panel_menu=cur_panel_menu;
	  	cur_panel_menu=id;
	  	if(document.getElementById(old_panel_menu))
   			if(document.getElementById(old_panel_menu).onmouseout)
	   			document.getElementById(old_panel_menu).onmouseout();
 		}

	
	function menu_over(id) {
	  if(id=='wsy') {
   		document.getElementById(id).style.backgroundImage="url(img/btn_top_lf_ws.gif)";
   		}
	  else if(id=='tur'){
   		document.getElementById(id).style.backgroundImage="url(img/btn_top_eshop_lf.gif)";
	   	document.getElementById(id+"2").style.backgroundImage="url(img/btn_top_eshop_rg2.gif)";
	   	} else {
   		document.getElementById(id).style.backgroundImage="url(img/btn_top_lf.gif)";
	   	document.getElementById(id+"2").style.backgroundImage="url(img/btn_top_rg2.gif)";
	   	}
	  }
 	
	function menu_out(id) {
	  
	  if(id=='wsy') {
   		document.getElementById(id).style.backgroundImage="none";
   		}
 	  else {
   		document.getElementById(id).style.backgroundImage="none";
	   	document.getElementById(id+"2").style.backgroundImage="url(img/btn_top_rg.gif)";
	  	}
  		
	   }
	   
	function menu_act(id) {
	  
	  	menu_over(id);
	  	}
	   
	function menu_ina(id) {
	  	menu_out(id);//hide_menu(id);
	  	}
	
	function menu_cur_ovr(id) {
   		ovr_cat=id;
 		}
	
	function menu_cur_out(id) {
   		ovr_cat='';
 		}
	
	function menu_clear() {
   		cats= new Array(7);
      		
      		cats[0]='wsy';
      		cats[1]='gas';
      		cats[2]='roz';
      		cats[3]='uro';
      		cats[4]='usl';
      		cats[5]='zak';
      		cats[6]='tur';
      		
      		for(i=0;i<7;++i) {
          		if(cats[i]==cur_cat || cats[i]==ovr_cat) menu_act(cats[i]);
          		else menu_ina(cats[i]);
 			}	   
   		}
   	function menu_clk(id) {
      		if(rol_cat!='')
      			hide_menu(rol_cat);
      		if(cur_cat!='')
		      menu_ina(cur_cat);
      		cur_cat=id;
      		menu_act(id);
      		
    		}
  		
 	
 	function navigate(link) {
    		document.location=link;
		}
		
	function rollover_menu(height, id, width) {
   		document.getElementById("menu_"+id).style.visibility="visible";
   		//rollover_h(id, 0, height);
   		document.getElementById("menu_"+id).style.height=height+"px";
   		//document.getElementById("menu_"+id).style.height=height+"px";
   		if(width!=0) {
   			document.getElementById("menu_"+id).style.width=width+"px";
     			}
	}
			
	function hide_menu(id) {
   		
   		if(id!='wsy' && id!='')
   			document.getElementById("menu_"+id).style.visibility="hidden";
	}
		
	function activate(id) {
   		document.getElementById("menu_"+id).style.visibility="visible";
	}
	
	function roll_clk(id) {
   		if(rol_cat!='')
		  	hide_menu(rol_cat);
	  	rol_cat=id;
 		}
	
	function rollover_h(id, from, to)	{
	  	
   		if(to>from+8) {
			from+=10;
   			document.getElementById("menu_"+id).style.height=from+"px";
			setTimeout("rollover_h('"+id+"', "+from+", "+to+")", 2);
			}
 	}
	
	function changeStyle(ID, className) {
   		document.getElementById(ID).className=className;
 	}
 	
 	function getValue(name) {
    		return document.getElementsByName(name)[0];
  	}
  	//ukrywa element
 	function hide(name) {
    		return document.getElementById(name).style.visibility="hidden";
  	}
  	//pokazuje go
 	function show(name) {
    		return document.getElementById(name).style.visibility="visible";
  	}
  	//ukrywa element
 	function hide2(name) {
    		return document.getElementById(name).style.display="none";
  	}
  	//pokazuje go
 	function show2(name) {
    		return document.getElementById(name).style.display="block";
  	}
  	
  	function get_autocompl_fircit(id, val, evt, field, form) {
  	  var old_cur_mc=0;
  	  	if(evt.keyCode!="40" && evt.keyCode!="38" && evt.keyCode!="13") {
     			show(id);
		     	request('get', id, 'what=fir_miecompl&val='+val+'&val2='+field+'&val3='+form+'&val4='+id, 0);
		    }
     		else {
         		if(evt.keyCode=="40") {//nacisnelismy w dol
         			old_cur_mc=cur_mieacpl;
         			++cur_mieacpl;
      				get_autocompl_fircit_helper1(old_cur_mc, id);
				}
         		else if(evt.keyCode=="38") {//nacisnelismy w gore
         			old_cur_mc=cur_mieacpl;
         			--cur_mieacpl;
         			if(cur_mieacpl<0) cur_mieacpl=0;
      				get_autocompl_fircit_helper1(old_cur_mc, id);
				}
         		else if(evt.keyCode=="13") {//nacisnelismy w return
         			document.getElementById('id_'+field).onblur();
				}
       			}
	}
	
	function get_autocompl_fircit_m(id, val, evt, field, form) {
  	  var old_cur_mc=0;
  	  	if(evt.keyCode!="40" && evt.keyCode!="38" && evt.keyCode!="13") {
     			show(id);
		     	request('get', id, 'what=fir_miecompl_m&val='+val+'&val2='+field+'&val3='+form+'&val4='+id, 0);
		    }
     		else {
         		if(evt.keyCode=="40") {//nacisnelismy w dol
         			old_cur_mc=cur_mieacpl;
         			++cur_mieacpl;
      				get_autocompl_fircit_helper1(old_cur_mc, id);
				}
         		else if(evt.keyCode=="38") {//nacisnelismy w gore
         			old_cur_mc=cur_mieacpl;
         			--cur_mieacpl;
         			if(cur_mieacpl<0) cur_mieacpl=0;
      				get_autocompl_fircit_helper1(old_cur_mc, id);
				}
         		else if(evt.keyCode=="13") {//nacisnelismy w return
         			//document.getElementById('id_'+field).onblur();
         			if(document.getElementById(id+'mieselacpl'+cur_mieacpl))
         				document.getElementById(id+'mieselacpl'+cur_mieacpl).onclick();
				}
       			}
	}
	
	function get_autocompl_firuli(id, val, evt, field, form, mid) {
  	  var old_cur_uc=0;
  	  	if(evt.keyCode!="40" && evt.keyCode!="38" && evt.keyCode!="13") {
     			show(id);
		     	request('get', id, 'what=fir_ulicompl&val='+val+'&val2='+field+'&val3='+form+'&val4='+id+'&val5='+mid, 0);
		    }
     		else {
         		if(evt.keyCode=="40") {//nacisnelismy w dol
         			old_cur_uc=cur_uliacpl;
         			++cur_uliacpl;
      				get_autocompl_firuli_helper1(old_cur_uc, id);
				}
         		else if(evt.keyCode=="38") {//nacisnelismy w dol
         			old_cur_uc=cur_uliacpl;
         			--cur_uliacpl;
         			if(cur_mieacpl<0) cur_uliacpl=0;
      				get_autocompl_firuli_helper1(old_cur_uc, id);
				}
         		else if(evt.keyCode=="13") {//nacisnelismy w dol
         			document.getElementById('id_'+field).onblur();
				}
       			}
	}
	
	function get_autocompl_fircit_helper1(old_cur_mc ,id) {
		if(document.getElementById(id+'mieselacpl'+cur_mieacpl)) {
      			document.getElementById(id+'mieselacpl'+cur_mieacpl).onmouseover();
			}
		else {
		   	cur_mieacpl=0;
      			if(document.getElementById(id+'mieselacpl'+cur_mieacpl))
	      		document.getElementById(id+'mieselacpl'+cur_mieacpl).onmouseover();
			}
   		if(document.getElementById(id+'mieselacpl'+old_cur_mc))
   			document.getElementById(id+'mieselacpl'+old_cur_mc).className='';
   		if(document.getElementById(id+'mieselacpl'+cur_mieacpl))
   			document.getElementById(id+'mieselacpl'+cur_mieacpl).className='acmplcit_hv';
 		}
	
	function get_autocompl_firuli_helper1(old_cur_uc ,id) {
		if(document.getElementById(id+'uliselacpl'+cur_uliacpl)) {
      			document.getElementById(id+'uliselacpl'+cur_uliacpl).onmouseover();
			}
		else {
		   	cur_uliacpl=0;
      			if(document.getElementById(id+'uliselacpl'+cur_uliacpl))
	      		document.getElementById(id+'uliselacpl'+cur_uliacpl).onmouseover();
			}
   		if(document.getElementById(id+'uliselacpl'+old_cur_uc))
   			document.getElementById(id+'uliselacpl'+old_cur_uc).className='';
   		if(document.getElementById(id+'uliselacpl'+cur_uliacpl))
   			document.getElementById(id+'uliselacpl'+cur_uliacpl).className='acmplcit_hv';
 		}
  	
  	function rgstr_fir_chck2() {
     		var nip_ok, fir_cat_ok, fir_sscat_ok, fir_loc_ok, fir_ulic_ok, fir_cit_ok, fir_nam_ok;
     		
   			nip_ok=document.register_fir.fir_nip_ok.value;
		fir_loc_ok=document.register_fir.fir_loc_ok.value;
		fir_ulic_ok=document.register_fir.fir_ulic_ok.value;
		fir_cit_ok=document.register_fir.fir_cit_ok.value;
		fir_nam_ok=document.register_fir.fir_nam_ok.value;
		fir_cat_ok=document.register_fir.fir_cat_ok.value;
		fir_sscat_ok=document.register_fir.fir_sscat_ok.value;
		
		if(nip_ok==1 && (fir_cat_ok==1 || fir_sscat_ok==1) && fir_loc_ok==1 && fir_ulic_ok==1 && fir_cit_ok==1 && fir_nam_ok==1) {
    				request('center', 'center_mainbox_left_reg_box', 'do=register&part=fir&step3=1', 0);
    				request('center', 'center_mainbox_right', 'do=register&part=txt_fir3', 0); 
				changeStyle('center_mainbox_left_reg_box', 'center_mainbox_left_reg_box_fir3');
			    }
		else {
    			alert('Uzupenij wszystkie wymagane pola');
  			}
		     
		}
	
	function ex_wiz2_callback() {
   		document.getElementById('step3exwiz22').innerHTML=tinyMCE.get('fir_opi').getContent();
 		}
	
	function ex_wiz2_callback2() {
   		document.getElementById('step3exwiz22').innerHTML=tinyMCE.get('fir_opi').getContent();
 		}
 		
 	function rgstr_fir_chck3() {//sprawdza pola kroku 3 i kieruje do kroku 4 rejestracji
 		request('center', 'center_mainbox_left_reg_box', 'do=register&part=fir&step4=1&val='+document.getElementById('new_multibe').value, 0);
					
		request('center', 'center_mainbox_right', 'do=register&part=txt_fir4', 0); 
		changeStyle('center_mainbox_left_reg_box', 'center_mainbox_left_reg_box_fir4');
    		
  		}
 		
 	function rgstr_fir_pom3() {//pomija krok 3 rej firm
    		request('center', 'center_mainbox_left_reg_box', 'do=register&part=fir&step4=1', 0);
		request('center', 'center_mainbox_right', 'do=register&part=txt_fir4', 0); 
		changeStyle('center_mainbox_left_reg_box', 'center_mainbox_left_reg_box_fir4');
  		}
		  
	function isset(varname){
		try {
			var t = typeof(varname);
			}
		catch(e) {return false;}
		
		if(t!=='undefined' && t != 'function') return true;
		else
		 return false;
		}	
		
	function rgstr_fir_pom4() {
   		request('center', 'center_mainbox_left_reg_box', 'do=register&part=fir&step5=1', 0);
		request('center', 'center_mainbox_right', 'do=register&part=txt_fir4', 0); 
		request('get', 'step2exwiz4', 'what=fir_exwiz1', 0);
		request('get', 'step3exwiz3', 'what=fir_exwiz3', 0);
		changeStyle('center_mainbox_left_reg_box', 'center_mainbox_left_reg_box_fir5');
   		
 		}
	function rgstr_fir_chck4() {
   		rgstr_fir_pom4();
 		}
	function rgstr_fir_chck5() {
	  	request('center', 'center_mainbox_left_reg_box', 'do=register&part=fir&step6=1', 0);
		request('center', 'center_mainbox_right', 'do=register&part=txt_fir1', 0); 
		changeStyle('center_mainbox_left_reg_box', 'center_mainbox_left_reg_box_fir6');
 		}
 		
 	function ogranicz(pole, max, ID){
		if (pole.value.length > max){
		  	 pole.value = pole.value.substr(0,max);
			}
		document.getElementById(ID).innerHTML='Pozostało <strong>'+(160-pole.value.length)+'</strong> znakw.';
} 
	
 		
	function potwierdzenie(strona) {
		var sprawdz = window.confirm("Usun?");
		if (sprawdz == true) {
			document.location.href = strona;
			return true;
			}
		else if (sprawdz == false) {
			return false;
			}
		}
		
	function change_stars(id, ile) {
	  	for(i=0;i<=ile;i++)
   			document.getElementById('vote_'+id+'_'+i).className='star_on';
 		}
		
	function clr_stars(id) {
	  	for(ile=0;ile<10;ile++)
   			document.getElementById('vote_'+id+'_'+ile).className='star_off';
 		}
 		
	function inner_text(id, text) {
   		document.getElementById(id).innerHTML=text;
 		}
 		
 	function show_newwindow(title, inner, w, m, h) {//tytul, wewnetrzny html, szer domyslnie 660, margin-top dom. 260px, wys dom. bez ogr.
   		   document.getElementById('new_win_title').innerHTML='<a onclick="hide_newwindow();" class="X"></a>'+title;
   		   document.getElementById('new_win_cont').innerHTML=inner;
   		   
		   document.getElementById('new_window').style.display='block';
		   
		   if(w>100)
		   	document.getElementById('new_win_main_box').style.width=w+'px';
		   
		   if(h>10)
		   	document.getElementById('new_win_cont').style.height=h+'px';
   		   window.location.href="#top_new_win"; 
		}
	
	function hide_newwindow() {
   		document.getElementById('new_window').style.display='none';
   		document.getElementById('new_win_title').innerHTML='<a onclick="hide_newwindow();" class="X"></a>';
   		document.getElementById('new_win_cont').innerHTML='';
   		document.getElementById('new_win_cont').style.overflow='visible';
 		}	
 		
	function show_img(src) {
	  	
	  	var inner='<center><a onclick="hide_newwindow();"><img style="max-width:640px; max-height:480px;" src="'+src+'" alt="" /></a></center>';
	  	show_newwindow('Zobacz powiększenie obrazka:', inner, 0, 0, 0);
   		
 		}		
	 	
 	function shw_crts_clk() {//jesli wart=0 to wtedy pokazuje UWAGA!!!
    		 
    		if(shwcarts) {
  			request('set', 'null', 'shwcarts=0', 0); 
			changeStyle('top3_pw', 'c0');
			}
		else {
  			request('set', 'null', 'shwcarts=1', 0); 
			changeStyle('top3_pw', 'c1');
  			}
		request('center', 'box_center', 'do=shw_oka', 0); 
		shwcarts=!shwcarts;
  		}
  		
	function usr_panel_change_opt(id) {
   		if(document.getElementById(id).className=='btn_on')
   			document.getElementById(id).className='btn_off'
   		else
   			document.getElementById(id).className='btn_on'
   		
 		}
 		
	function show_reg() {
   		show_newwindow('Regulamin serwisu DorwijOkazje.pl', '', 1000, 0, 700);
   		document.getElementById('new_win_cont').style.overflow='auto';
   		request('consts', 'new_win_cont', 'do=reg', 1);
   		
 		}
 		
	function show_privacy() {
   		show_newwindow('Polityka prywatności w serwisie DorwijOkazje.pl', '', 980, 0, 410);
   		request('consts', 'new_win_cont', 'do=prv', 1);
   		
 		}
 		
	function show_examples() {
   		show_newwindow('Przykłady okazji', '', 980, 0, 725);
   		request('consts', 'new_win_cont', 'do=exs', 1);
   		
 		}
 		
	function show_frs() {
   		show_newwindow('Pierwszy raz tutaj?', '', 1010, 0, 644);
   		request('consts', 'new_win_cont', 'do=frs', 1);
   		}
		
	function show_onas() {
   		show_newwindow('Dowiedz sie wiecej o nas i naszej misji', '', 750, 0, 610);
   		request('consts', 'new_win_cont', 'do=onas', 1);
   		}
 		
	function show_mobi() {
   		show_newwindow('Zgarniaj Okazje na komórkę!', '', 982, 0, 619);
   		request('consts', 'new_win_cont', 'do=mobi', 1);
   		}
 		
	function show_mobi_site() {
   		show_newwindow('Dorwij Okazje komórce! Strony mobilne dla komórek i dla iPhone.', '', 720, 0, 590);
   		request('consts', 'new_win_cont', 'do=mobisite', 1);
   		}

	function show_gg() {
   		show_newwindow('Zgarniaj Okazje na Gadu-Gadu!', '', 720, 0, 590);
   		request('consts', 'new_win_cont', 'do=gg', 1);
   		}

	function show_buttons() {
   		show_newwindow('Jeżeli chcesz to dołącz wybrany przycisk na swojej stronie!', '', 720, 0, 590);
   		request('consts', 'new_win_cont', 'do=buttons', 1);
   		}
		
	function custom_widget(id) {
   		show_newwindow('Widget DorwijOkazje.pl', '', 720, 0, 506);
   		request('consts', 'new_win_cont', 'do=custom_widget&id='+id, 1);
  		}
 		
	function show_kont(text, email, type) {
	  	var tit='';
		if(type==0) tit='Skontaktuj się z Nami';
		else if(type==1) tit='Przekaż nam swoje sugestie';
		else tit='Zgłoś błąd';
   		show_newwindow(tit, '', 425, 0, 270);
   		request('get', 'new_win_cont', 'what=main_kont&text='+text+'&type='+type+'&email='+email, 0);
   		
 		}
		 
		
	function add_city() {
   		show_newwindow('Dodaj miejscowość', '', 310, 0, 230);
   		request('get', 'new_win_cont', 'what=add_city', 1);
  		}	
 		
		
	function add_uli() {
   		show_newwindow('Dodaj ulicę', '', 310, 0, 115);
   		request('get', 'new_win_cont', 'what=add_uli', 1);
  		}	
 		
	function load_numofoka() {
		request('get', 'btn_top_saved_a', 'what=cur_noo', 0);
 		}
 		
	function mouseX(evt) {
		if (evt.pageX) return evt.pageX;
		else if (evt.clientX)
		   return evt.clientX + (document.documentElement.scrollLeft ?
		   document.documentElement.scrollLeft :
		   document.body.scrollLeft);
		else return null;
		}

	function mouseY(evt) {
		if (evt.pageY) return evt.pageY;
		else if (evt.clientY)
	 	  return evt.clientY + (document.documentElement.scrollTop ?
	 	  document.documentElement.scrollTop :
	 	  document.body.scrollTop);
		else return null;
		}	
 		
	function move_dymek(evt) {
   		show2('dymek');
   		document.getElementById('dymek').style.marginLeft=(mouseX(evt)-185)+'px';
   		document.getElementById('dymek').style.marginTop=(mouseY(evt)-75)+'px';
		}
 		
	function hide_dymek() {
   		hide2('dymek');
   		document.getElementById('dymek').innerHTML='';
 		}
 		
	function show_dymek(num) {
	  	var txt='';
		switch(num) {
      			default:txt='<br />Już dorwałeś/aś tą Okazję.';break;
      			case'1':txt='<strong>Dziękujemy</strong><br />za zachęcenie firmy do dodawania Okazji.';break;
      			case'2':txt='Masz wpływ na to jak często będą pojawiać się ciekawe Okazje.';break;
      			case'3':txt='Pokaż kupon w punkcie. <strong>WYDRUKUJ</strong>';break;
      			case'4':txt='<br />Kliknij aby <strong>DORWAĆ</strong> tą Okazję.';break;
      			case'6':txt='<strong>Zaloguj się</strong> aby korzystać z tej opcji. Nie masz konta? <strong>Zarejestruj się</strong>';break;
      			case'7':txt='Twoi Klienci mogą zachęcać Twoją firmę do dodanie okazji przez tzw. <strong>oflagowanie</strong>.';break;
      			case'8':txt='Twoi Klienci w ten sposób mogą szybko <strong>zapisać wybrane Okazje</strong>.';break;
      			
    			}
   		show2('dymek');
   		document.getElementById('dymek').innerHTML=txt;
 		}
 		
 	function print_oka(title, cont, rules, name, addres, tel,timestamp, code) {
    		var txt;
    		
    		txt='<div id="coupon01" class="coupon_bg">';
		txt+='	<img src="img/user/coupon_bg.gif" width="318" height="318" />';
		txt+='</div>';
		txt+='<div id="coupon01" class="coupon_above_bg">';
		txt+='	<div style="width:294px;display:block;position:absolute;top:65px;left:15px; height:200px;" onmouseover="this.style.cursor=\'pointer\';" onclick="window.location.href=\'http://link do strony firmy na okazjach\'">';	
		txt+='		<div class="coupon_company_name">'+name+'</div>';
		txt+='		<div style="clear:both;">';
		txt+='            <div class="coupon_address">';
		txt+='                '+addres+'<br />';
		txt+='                tel.'+tel+'<br />';
		txt+='            </div>';
		txt+='			<div class="coupon_logo">';
		txt+='					<img src="obrazek_example.jpg" width="140" height="88" />';
		txt+='        	</div>';
		txt+='		</div>';
		txt+='		<div class="coupon_deal_title"><strong>'+title+'</strong></div>';
		txt+='		<div class="coupon_deal_txt">'+''+'</div>';//cont
		txt+='	</div>	';
		if(code!='') {
			txt+='	<div class="coupon_code1">Twój Kod Promocyjny:</div>';
			txt+='	<div class="coupon_code2">'+code+'</div>';
			}
		txt+='	<div class="coupon_footer"><strong>Warunki skorzystania:</strong><br />'+rules+'</div>';
		txt+='</div>';
    				
		document.getElementById('print_only').innerHTML=txt;
		
		txt='<div id="coupon02" class="coupon_bg">';
		txt+='	<img src="img/user/coupon_bg.gif" width="318" height="318" />';
		txt+='</div>';
		txt+='<div id="coupon02" class="coupon_above_bg">';
		txt+='	<div style="height:200px;">';	
		txt+='		<div class="coupon_company_name">'+name+'</div>';
		txt+='		<div style="clear:both;">';
		txt+='            <div class="coupon_address">';
		txt+='                '+addres+'<br />';
		txt+='                tel.'+tel+'<br />';
		txt+='            </div>';
		txt+='			<div class="coupon_logo">';
		txt+='					<img src="obrazek_example.jpg" width="140" height="88" />';
		txt+='        	</div>';
		txt+='		</div>';
		txt+='		<div class="coupon_deal_title"><strong>'+title+'</strong></div>';
		txt+='		<div class="coupon_deal_txt">'+''+'</div>';//cont
		txt+='	</div>	';
		if(code!='') {
			txt+='	<div class="coupon_code1">Twój Kod Promocyjny:</div>';
			txt+='	<div class="coupon_code2">'+code+'</div>';
			}
		txt+='	<div class="coupon_footer"><strong>Warunki skorzystania:</strong><br />'+rules+'</div>';
		txt+='</div>';
		
   		show_newwindow('Aktulanie drukowane:', '', 340, 0, 315);
		document.getElementById('new_win_cont').innerHTML='<div id="print_prev" style="background-color:#fff; height:318px;">'+txt+'</div>';
		window.print();
  		}	
	
	
	function login_snd(evt) {
   		if(evt.keyCode=="13") {
   			document.getElementById('loginme_btn').onclick();
   			 return false;
   			}
 		}
 		
	function fir_orgoka_get_startstopmes(bylo, bedzie, koszt, status, id) {
	  	text='';
		if(status==1) {
		  	text='';
		  	/*
    			text='Jeżeli wstrzymasz wyświetlanie okazji zostanie pobrana opłata za '+bylo;
    			if(bylo==1) text+=' dzień ';
    			else text+=' dni ';
    			text+='wyświetlania okazji w wysokości: '+(koszt*bylo)+' zł';
    			text+='<br /><em>Na Twoje konto zwrócimy '+(koszt*bedzie)+' zł gdyż wstrzymałeś/aś wyświetlanie okazji przez kolejne '+bedzie+' dni</em>';
    			*/
			}
		else if(status==2) {
		  	text='';
		  	//text='<br />Gdy ponownie włączysz okazję, z Twojego konta zostanie pobrana opłata w wysokości '+(bedzie*koszt)+'zł za pozostałe dni wyświetlania okazji.';
  			}
		else if(status == 3){
		  	text='';
    			//text='<br /><strong>Nie posiadasz wystarczających środków aby wznowić tą Okazje. Doładuj konto.</strong>';
  			}
		else
			text='<br /><strong>Nie możesz wznowić tej Okazji.</strong>';
		document.getElementById('fir_orgoka_startstop'+id).style.backgroundColor='#fff';
		document.getElementById('fir_orgoka_startstop'+id).style.border='1px solid #32b1c4';
		document.getElementById('fir_orgoka_startstop'+id).style.width='700px';
		document.getElementById('fir_orgoka_startstop'+id).style.paddingTop='10px';
		document.getElementById('fir_orgoka_startstop'+id).innerHTML=text;
 		}
 		
	function fir_orgoka_clr_startstopmes(id) {
		document.getElementById('fir_orgoka_startstop'+id).innerHTML='';
		document.getElementById('fir_orgoka_startstop'+id).style.backgroundColor='';
		document.getElementById('fir_orgoka_startstop'+id).style.border='0px';
	
 		}
 		
	function show_gmap(la, lo, mid) {
   		show_newwindow('Zobacz okazje na mapie:', '', 631, 0, 461);

   		request('gmap', 'new_win_cont', 'do=mie&la='+la+'&lo='+lo+'&mid='+mid, 1);
   	
   		}
 		
	function show_gmap2(la, lo, cid) {
   		show_newwindow('Zobacz firmę na mapie:', '', 631, 0, 358);

   		request('gmap', 'new_win_cont', 'do=fir&la='+la+'&lo='+lo+'&cid='+cid, 1);
   	
   		}
 		
 	function show_hide_reg(chk) {
     			if(chk) {
	         		//sklep
	       			document.getElementById('selectbox1').style.display='none';
	       			document.getElementById('selectbox2').style.display='none';
	       			document.getElementById('selectbox3').style.display='block';
				}
     			else {
	         		//normal
	       			document.getElementById('selectbox1').style.display='block';
	       			document.getElementById('selectbox2').style.display='block';
	       			document.getElementById('selectbox3').style.display='none';
	       			}
   			}
   			
	function cur_subcat_style(shop) {
   		if(shop) {
       			//jesli sklep zmieniamy kilka rzeczy
    			document.getElementById('top3_selcat_1').style.backgroundImage="url(img/top3_lf2.jpg)";
    			document.getElementById('top3_selcat_2').style.backgroundColor="#b74fb6";
    			document.getElementById('top3_selcat_3').style.backgroundImage="url(img/top3_rg2.jpg)";
	       		document.getElementById('top3_selcat_txt').innerHTML='Sklepy Internetowe:';
     			}
		else {
    			//jezeli nie to tez :-)
    			document.getElementById('top3_selcat_1').style.backgroundImage="url(img/top3_lf.jpg)";
    			document.getElementById('top3_selcat_2').style.backgroundColor="#879ec2";
    			document.getElementById('top3_selcat_3').style.backgroundImage="url(img/top3_rg.jpg)";
	       		document.getElementById('top3_selcat_txt').innerHTML='Wybrana kategoria:';
  			}
 		}
 	function show_partners() {
		show_newwindow('Nasi Zaufani PARTNERZY', '', 1010, 0, 590);
		request('consts', 'new_win_cont', 'do=partners', 1);
		}  

 		
 		

