var ieshit=0;

if(-1 != navigator.userAgent.indexOf("MSIE"))
{
	// Internet Explorer
	document.write('<link href="/media/styles/styleie.css" rel="stylesheet" type="text/css" />');
	document.write('<script type="text/javascript" src="/media/scripts/pngFix/jquery.pngFix.pack.js"></script> ');  
	ieshit=1; 
}else{
	// other
	document.write('<link href="/media/styles/style.css" rel="stylesheet" type="text/css" /><link href="/media/styles/layout.css" rel="stylesheet" type="text/css" />');
	
}




//wyszukiwarka z nagłówka
function szukajSubmit(){
	
	document.location='http://www.naturatour.pl/szukaj/'+$('#szukaj_rodz_sel').val()+'.html';
	
}


$(window).load(function() {
//$(function() {
	
	if(ieshit==1){
	 //$(document).pngFix(); 
	 //$('#headFormBlock').pngFix(); 
	 $('#header').pngFix(); 
	}
	
	$("#blok_rozkladPKP").liquidCanvas(
            "[shadow border gradient] => roundedRect{radius:50}");
	
	$(".bloczek").liquidCanvas(
	"[shadow {width:3; color:'#DCDCD9'; shift:3 } fill{color:#fff} gradient{from:#FAFAFA; to:#FFFAFA;}] => roundedRect{corner:8}");
	
	
	$(".block").liquidCanvas(
				"[shadow {width:3; color:'#DCDCD9'; shift:3 } fill{color:#fff} gradient{from:#FAFAFA; to:#FFFAFA;}] => roundedRect{corner:8}");
	
	
	//btn.init();
	
});

function strstr (haystack, needle, bool) {
    var pos = 0;
    
    haystack += '';
    pos = haystack.indexOf( needle );
    if (pos == -1) {
        return false;
    } else{
        if (bool){
            return haystack.substr( 0, pos );
        } else{
            return haystack.slice( pos );
        }
    }
}


function rozkladPKP(){
	
	$.ajax({
	   type: "POST",
	   url: "/ajax/natura_obiekty/strstr.html",
	   data: "od="+$("#pkp-do").val()+"&do="+$("#pkp-od").val(),
	   success: function(msg){
	     var temp = new Array();
	     
	     temp=msg.split("&&");
	   	//Czw, 13.11.09
	    // $.fn.colorbox({href:'http://rozklad-pkp.pl/index.php?S=%27.'+temp[0]+'.%27&Z=%27.'+temp[1]+'.%27&date=%27.Czw,%2012.11.09.%27&time=%27.16.43.%27&start=1&search=Szukaj&tmp', iframe:true, width:'80%', height:600, open:true});
	   	$.fn.colorbox({href:'http://rozklad-pkp.pl/index.php?S=%27.'+temp[0]+'.%27&Z=%27.'+temp[1]+'.%27&date=%27.'+$("#pkp-data").val()+'.%27&time=%27.'+$('#pkp-godzina').val()+'.%27&start=1&search=Szukaj&tmp', iframe:true, width:'80%', height:600, open:true});
	   	
	   }
	 });
	

}
