﻿//---------------------------butony

  if (document.images)
   {
   
   //------------but_menu_kategorie preload hover
   k_relacje= new Image(300,36);
   k_relacje.src="images/main/relacje_z.gif"; 

   k_horyzonty= new Image(300,36);
   k_horyzonty.src="images/main/horyzonty_z.gif"; 
   
   k_wasz_film= new Image(300,36);
   k_wasz_film.src="images/main/wasz_film_z.gif"; 
   
    //------------but_polecane preload hover
   k_pol_relacje= new Image(152,86);
   k_pol_relacje.src="images/main/tlo_polecane_relacje_z.gif"; 

   k_pol_horyzonty= new Image(152,86);
   k_pol_horyzonty.src="images/main/tlo_polecane_horyzonty_z.gif"; 
   
   k_pol_wasz_film= new Image(152,86);
   k_pol_wasz_film.src="images/main/tlo_polecane_wasz_film_z.gif"; 
   
   //---------------------------------------- 
 
   pic1on= new Image(98,22);
   pic1on.src="images/main/nasza_ramowka_z.gif";  
   pic1off= new Image(98,22);
   pic1off.src="images/main/nasza_ramowka.gif";
   
   pic2on= new Image(121,23);
   pic2on.src="images/main/dodaj_plik_z.gif";  
   pic2off= new Image(121,23);
   pic2off.src="images/main/dodaj_plik.gif";
   
  
   }
   

   //---butony funkcje------------------------------------
function lightup(imgName)
 {
   if (document.images)
    {
      imgOn=eval(imgName + "on.src");
      document[imgName].src= imgOn;
    }
 }

function turnoff(imgName)
 {
   if (document.images)
    {
      imgOff=eval(imgName + "off.src");
      document[imgName].src= imgOff;
    }
 }
//--------------------------------------------------------------------

//--------------------------------------caly opis
function pokaz_caly_opis()
{
$('caly_opis').style.display = "block";
}

function zamknij_caly_opis()
{
$('caly_opis').style.display = "none";
}

//-------------------------------------------cale tagi

function pokaz_cale_tagi()
{
$('caly_opis2').style.display = "block";
}

function zamknij_cale_tagi()
{
$('caly_opis2').style.display = "none";
}

//-----------------------------flash glowny

window.addEvent('domready', function(){
 var obj_m1 = new Swiff('images/main/vcanal1.swf', {
    width:  900, 
    height: 82, 
    container: $('flash1v'),
	params: {
        bgcolor: '#e9e9e9'
		},
    events: {
        onLoad: function() {
         	//m_onload();
        }
    }	
});

});
//----------


////-------------------------------------------onload_film
function v_onload_film() //film, playlist
{

	//--------komentarze

window.addEvent('domready', function() {

	var myVerticalSlide = new Fx.Slide('content_koment');
		myVerticalSlide.hide();	
		
});

//-----------komentarze--------koniec

TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family: Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#ffffff";
TICKER_PAUSED = false;
ticker_start();

window.addEvent('domready', function(){

$('caly_opis').style.display = "none";
$('caly_opis2').style.display = "none";

document.body.style.display="block";
if($('content'))
{
var slider_on = $('content').getScrollSize().y;
if (slider_on > 472)
{
$('thumb').className = 'thumb_strona_gl';

 var obj_m2 = new Swiff('images/main/sowak.swf', {
    width:  25, 
    height: 30, 
    container: $('thumb'),
	params: {
        bgcolor: '#e9e9e9'
		},
    events: {
        onLoad: function() {
         	//m_onload();
        }
    }	
});

}
}
		$('drop_down_menu').getElements('li.menu').each( function( elem ){
			var list = elem.getElement('ul.links');	
			var myFx = new Fx.Slide(list).hide();			
			elem.addEvents({
				'mouseenter' : function(){ 					
					myFx.cancel();
					myFx.slideIn();					
				},
				'mouseleave' : function(){ 
					myFx.cancel();
					myFx.slideOut();					
				}
			});	
			
		
	})
		makeScrollbar( $('content'), $('track'), $('thumb'));	
	});	
	

}	
//----------------------------------onload_film_koniec



////-------------------------------------------onload_uzytkownik
function v_onload_uzytkownik() //uzytkowanik
{

TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family: Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#ffffff";
TICKER_PAUSED = false;
ticker_start();

window.addEvent('domready', function(){

document.body.style.display="block";
if($('content'))
{
var slider_on = $('content').getScrollSize().y;
if (slider_on > 472)
{
$('thumb').className = 'thumb_strona_gl';

 var obj_m2 = new Swiff('images/main/sowak.swf', {
    width:  25, 
    height: 30, 
    container: $('thumb'),
	params: {
        bgcolor: '#e9e9e9'
		},
    events: {
        onLoad: function() {
         	//m_onload();
        }
    }	
});

}	
}
		$('drop_down_menu').getElements('li.menu').each( function( elem ){
			var list = elem.getElement('ul.links');	
			var myFx = new Fx.Slide(list).hide();			
			elem.addEvents({
				'mouseenter' : function(){ 					
					myFx.cancel();
					myFx.slideIn();					
				},
				'mouseleave' : function(){ 
					myFx.cancel();
					myFx.slideOut();					
				}
			});	
			
		
	})
		makeScrollbar( $('content'), $('track'), $('thumb'));	
	
	});	
	

}	
//----------------------------------onload_uzytkowanik_koniec



////-------------------------------------------onload_opis
function v_onload_opis() //opis, opisy
{

TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family: Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#ffffff";
TICKER_PAUSED = false;
ticker_start();

window.addEvent('domready', function(){

document.body.style.display="block";

var slider_on = $('content').getScrollSize().y;
if (slider_on > 472)
{
$('thumb').className = 'thumb_strona_gl';

 var obj_m2 = new Swiff('images/main/sowak.swf', {
    width:  25, 
    height: 30, 
    container: $('thumb'),
	params: {
        bgcolor: '#e9e9e9'
		},
    events: {
        onLoad: function() {
         	//m_onload();
        }
    }	
});

}
		$('drop_down_menu').getElements('li.menu').each( function( elem ){
			var list = elem.getElement('ul.links');	
			var myFx = new Fx.Slide(list).hide();			
			elem.addEvents({
				'mouseenter' : function(){ 					
					myFx.cancel();
					myFx.slideIn();					
				},
				'mouseleave' : function(){ 
					myFx.cancel();
					myFx.slideOut();					
				}
			});	
			
		
	})
		makeScrollbar( $('content'), $('track'), $('thumb'));	
	});	
	

	
}	
//----------------------------------onload_opis_koniec




////--------------------
function v_onload_rejestracja() //rejestracja, logowanie
{
TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family: Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#ffffff";
TICKER_PAUSED = false;
ticker_start();

window.addEvent('domready', function(){

document.body.style.display="block";

		$('drop_down_menu').getElements('li.menu').each( function( elem ){
			var list = elem.getElement('ul.links');	
			var myFx = new Fx.Slide(list).hide();			
			elem.addEvents({
				'mouseenter' : function(){ 					
					myFx.cancel();
					myFx.slideIn();					
				},
				'mouseleave' : function(){ 
					myFx.cancel();
					myFx.slideOut();					
				}
			});	
			
		
	})
	});	
	
}	
//----------------------------------onload_rejestracja_koniec


//----------------------------------onload_upload
////--------------------
function v_onload_upload() //rejestracja, logowanie
{
TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family: Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#ffffff";
TICKER_PAUSED = false;
ticker_start();

window.addEvent('domready', function(){

document.body.style.display="block";
	});	
	
}	
//----------------------------------onload_upload_koniec



function v_onload_filmy() //filmy uzytkowanika po zalogowaniu
{
TICKER_CONTENT = document.getElementById("TICKER").innerHTML;
TICKER_RIGHTTOLEFT = false;
TICKER_SPEED = 2;
TICKER_STYLE = "font-family: Arial, Helvetica, Verdana, sans-serif; font-size:12px; color:#ffffff";
TICKER_PAUSED = false;
ticker_start();

window.addEvent('domready', function(){

document.body.style.display="block";

var slider_on = $('content').getScrollSize().y;
if (slider_on > 410)
{
$('thumb').className = 'thumb_strona_gl';

 var obj_m2 = new Swiff('images/main/sowak.swf', {
    width:  25, 
    height: 30, 
    container: $('thumb'),
	params: {
        bgcolor: '#e9e9e9'
		},
    events: {
        onLoad: function() {
         	//m_onload();
        }
    }	
});

}
		$('drop_down_menu').getElements('li.menu').each( function( elem ){
			var list = elem.getElement('ul.links');	
			var myFx = new Fx.Slide(list).hide();			
			elem.addEvents({
				'mouseenter' : function(){ 					
					myFx.cancel();
					myFx.slideIn();					
				},
				'mouseleave' : function(){ 
					myFx.cancel();
					myFx.slideOut();					
				}
			});	
			
		
	})
		makeScrollbar( $('content'), $('track'), $('thumb'));	
	});	
	
}	
//----------------------------------onload_filmy_koniec
	


	
//--------- playlista scrollbar
	function makeScrollbar(content,scrollbar,handle,horizontal,ignoreMouse){
		if(content && scrollbar && handle)
		{
				var steps = (horizontal?(content.getScrollSize().x - content.getSize().x):(content.getScrollSize().y - content.getSize().y))
				var slider = new Slider(scrollbar, handle, {	
					steps: steps,
					mode: (horizontal?'horizontal':'vertical'),
					onChange: function(step){
						// Scrolls the content element in x or y direction.
						var x = (horizontal?step:0);
						var y = (horizontal?0:step);
						content.scrollTo(x,y);
					}
				}).set(0);
				if( !(ignoreMouse) ){
					// Scroll the content element when the mousewheel is used within the 
					// content or the scrollbar element.
					$$(content, scrollbar).addEvent('mousewheel', function(e){	
						e = new Event(e).stop();
						var step = slider.step - e.wheel * 30;	
						slider.set(step);					
					});
				}
				// Stops the handle dragging process when the mouse leaves the document body.
				$(document.body).addEvent('mouseleave',function(){slider.drag.stop()});
		}
			}
	

	
//----koniec_scrollbar
//------------------------------------------------



//----ticker funkcje
function ticker_start() {
	var tickerSupported = false;
	TICKER_WIDTH = document.getElementById("TICKER").style.width;
	//var img = "<img src=ticker_space.gif width="+TICKER_WIDTH+" height=0>";
	var img = "";

	// Firefox
	if (navigator.userAgent.indexOf("Firefox")!=-1 || navigator.userAgent.indexOf("Safari")!=-1) {
		document.getElementById("TICKER").innerHTML = "<TABLE  cellspacing='0' cellpadding='0' width='100%'><TR><TD nowrap='nowrap'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'>&nbsp;</SPAN>"+img+"</TD></TR></TABLE>";
		tickerSupported = true;
	}
	// IE
	if (navigator.userAgent.indexOf("MSIE")!=-1 && navigator.userAgent.indexOf("Opera")==-1) {
		document.getElementById("TICKER").innerHTML = "<DIV nowrap='nowrap' style='width:100%;'>"+img+"<SPAN style='"+TICKER_STYLE+"' ID='TICKER_BODY' width='100%'></SPAN>"+img+"</DIV>";
		tickerSupported = true;
	}
	if(!tickerSupported) document.getElementById("TICKER").outerHTML = ""; else {
		document.getElementById("TICKER").scrollLeft = TICKER_RIGHTTOLEFT ? document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth : 0;
		document.getElementById("TICKER_BODY").innerHTML = TICKER_CONTENT;
		document.getElementById("TICKER").style.display="block";
		TICKER_tick();
	}
}

function TICKER_tick() {
	if(!TICKER_PAUSED) document.getElementById("TICKER").scrollLeft += TICKER_SPEED * (TICKER_RIGHTTOLEFT ? -1 : 1);
	if(TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft <= 0) document.getElementById("TICKER").scrollLeft = document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth;
	if(!TICKER_RIGHTTOLEFT && document.getElementById("TICKER").scrollLeft >= document.getElementById("TICKER").scrollWidth - document.getElementById("TICKER").offsetWidth) document.getElementById("TICKER").scrollLeft = -1000;
	window.setTimeout("TICKER_tick()", 30);
}	
//koniec ticker
//---------------------------------------------------------




//-----------------------------------------------------------------------------------	
//-----------------------------------------------------------------------------------	
//menu podmia klasy

	function l_r()
	{
	document.getElementById('link_r').className = 'link_relacje2';
	}
	
	function l_r1()
	{
	document.getElementById('link_r').className = 'link_relacje';
	}
	
	function l_h()
	{
	document.getElementById('link_h').className = 'link_horyzonty2';
	}
	
	function l_h1()
	{
	document.getElementById('link_h').className = 'link_horyzonty';
	}
	
	function l_w()
	{
	document.getElementById('link_w').className = 'link_wasz_film2';
	}
	
	function l_w1()
	{
	document.getElementById('link_w').className = 'link_wasz_film';
	}

//-----------------------------------------------------------------------------------	
//-----------------------------------------------------------------------------------	

//---------------------------------------validacja
//----------------------------------------------------------------
// szukaj
function isEmpty1() {
szukajjj = document.getElementById('szukaj').value;

    if (szukajjj == "szukane słowo")
	{
	document.getElementById('szukaj').value="";
    }
}

function isEmpty1_a() {
szukajjj = document.getElementById('szukaj').value;

	if (szukajjj == "")
    {
	document.getElementById('szukaj').value="szukane słowo";
    }
}

//  przypomnij email
function isEmpty2() {
przypp = document.getElementById('przyp').value;

    if (przypp == "wprowadź adres e-mail")
	{
	document.getElementById('przyp').value="";
    }
}

function isEmpty2_a() {
przypp = document.getElementById('przyp').value;

	if (przypp == "")
    {
	document.getElementById('przyp').value="wprowadź adres e-mail";
    }
}


// login
function isEmpty3() {
loginnn = document.getElementById('loginn').value;

    if (loginnn == "login")
	{
	document.getElementById('loginn').value="";
    }
}

function isEmpty3_a() {
loginnn = document.getElementById('loginn').value;

	if (loginnn == "")
    {
	document.getElementById('loginn').value="login";
    }
	
}


// haslo
function isEmpty4() {
haslooo = document.getElementById('hasloo').value;

    if (haslooo == "hasło")
	{
	document.getElementById('hasloo').type = 'password';
	document.getElementById('hasloo').value="";	
    }
}

function isEmpty4_a() {
haslooo = document.getElementById('hasloo').value;

	if (haslooo == "")
    {
	document.getElementById('hasloo').type = 'text';
	document.getElementById('hasloo').value="hasło";
    }
}


// haslo ie
function isEmpty4ie() {
haslooo = document.getElementById('hasloo').value;

    if (haslooo == "hasło")
	{
	document.getElementById('hasloo').value="";	
    }
}

function isEmpty4_aie() {
haslooo = document.getElementById('hasloo').value;

	if (haslooo == "")
    {
	document.getElementById('hasloo').value="hasło";
    }
}


//-------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------

	
// sprawdzanie osoby ktora sie rejestruje

	function RejestracjaOsoba(rodzaj_osoby_prawnej)
	{
	if (rodzaj_osoby_prawnej == 'prywatna')
	{
	$('nip_opis').style.color ='#979797';
	$('firma_opis').style.color ='#979797';	
	$('firma').disabled=true;
	$('firma').style.backgroundColor="#d0d0d0";
	$('firma').style.borderColor="#dedede";
	$('nip').disabled=true;	
	$('nip').style.backgroundColor="#d0d0d0";
	$('nip').style.borderColor="#dedede";
	}
	else
	{
	$('nip_opis').style.color ='#3a3a3a';
	$('firma_opis').style.color ='#3a3a3a';	
	$('firma').disabled=false;
	$('firma').style.backgroundColor="#cacaca";
	$('firma').style.borderColor="#ffffff";
	$('nip').disabled=false;	
	$('nip').style.backgroundColor="#cacaca";
	$('nip').style.borderColor="#ffffff";
	}

	}	
	
	
	
	
	
	
	
	
		//--------komentarze rozwijanie

function toggle() {

window.addEvent('domready', function() {

	var myVerticalSlide = new Fx.Slide('content_koment');		
		myVerticalSlide.toggle();
	
});
}

function koment_but() {
 toggle();
 
}

//-----------komentarze rozwijanie--------koniec