<!-- Hide the script from old browsers --

// funkcje do ustawiania ciasteczek
function Set_Cookie( name, value, path, domain, secure ) {
	var today = new Date();
	today.setTime( today.getTime() );
	
	expires = 7 * 1000 * 60 * 60 * 24; // 7 dni
	
	var expires_date = new Date( today.getTime() + (expires) );
	
	document.cookie = name + "=" +escape( value ) +
		( ( expires ) ? ";expires=" + expires_date.toGMTString() : "" ) + 
		( ( path ) ? ";path=" + path : "" ) + 
		( ( domain ) ? ";domain=" + domain : "" ) +
		( ( secure ) ? ";secure" : "" );
}

function Get_Cookie( name ) {
	var start = document.cookie.indexOf( name + "=" );
	var len = start + name.length + 1;
	if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
		return null;
	}
	if ( start == -1 ) return null;
	var end = document.cookie.indexOf( ";", len );
	if ( end == -1 ) end = document.cookie.length;
	return unescape( document.cookie.substring( len, end ) );
}

function Delete_Cookie( name, path, domain ) {
	if ( Get_Cookie( name ) ) document.cookie = name + "=" +
		( ( path ) ? ";path=" + path : "") +
		( ( domain ) ? ";domain=" + domain : "" ) +
		";expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// koniec funkcji do ustawiania ciasteczek


var up,down;
var min1,sec1;
var cmin1,csec1,cmin2,csec2;

function Minutes(data) {
  for(var i=0;i<data.length;i++) if(data.substring(i,i+1)==":") break;
  return(data.substring(0,i));
}

function Seconds(data) {
  for(var i=0;i<data.length;i++) if(data.substring(i,i+1)==":") break;
  return(data.substring(i+1,data.length));
}

function Display(min,sec) {
  var disp;
  if(min<=9) disp=" 0";
  else disp=" ";
  disp+=min+":";
  if(sec<=9) disp+="0"+sec;
  else disp+=sec;
  return(disp);
}

function Up() {
  cmin1=0;
  csec1=0;
  min1=0+Minutes(document.sw.beg1.value);
  sec1=0+Seconds(document.sw.beg1.value);
  UpRepeat();
}

function UpRepeat() {
  csec1++;
  if(csec1==60) { csec1=0; cmin1++; }
  document.sw.disp1.value=Display(cmin1,csec1);
  if((cmin1==min1)&&(csec1==sec1)) alert("Czas odliczania został zatrzymany!");
  else up=setTimeout("UpRepeat()",1000);
}

function Down() {
  if (Get_Cookie( 'clock_is_ticking' ) == null) { Set_Cookie( 'clock_is_ticking', '1', '/', '', '' ); }
  cmin2=1*Minutes(document.sw.beg2.value);
  csec2=0+Seconds(document.sw.beg2.value);
  DownRepeat();
}

function DownRepeat() {
  csec2--;
  if(csec2==-1) { csec2=59; cmin2--; }
  document.sw.disp2.value=Display(cmin2,csec2);
  if((cmin2==0)&&(csec2==0)) { Set_Cookie( 'clock_is_ticking', '0', '/', '', '' ); alert("Przykro nam, ale nie podjąleś decyzji we właściwym czasie!"); }
  else down=setTimeout("DownRepeat()",1000);
}

noPop = false;

function setPop() {
    noPop = true;
    if (linkid == 2779) {
     window.location.href='http://www.kalkulatory-finansowe.pl';
    }
    else {
    window.location.href='https://www.fts.pl';
    }
}



function loadpopup() {
	span=false;
	if ((linkid>2421) && (linkid<2462) && (linkid!=2127) && (linkid!=2128) && (linkid!=2478)) { span=true; }
	if (noPop!=true && (linkid!=435) && !span) {
//	 if (document.cookie.indexOf("popcontrol") == -1) {
		var expdate = new Date((new Date()).getTime() + 1000*60*5);  // 5 Minutes
		document.cookie="popcontrol; expires=" + expdate.toGMTString() + "; path=/;";
		var centerWidth=(screen.width/2)-(485/2);
		var centerHeight=(screen.height/2)-(450/2);
		consult = window.open("http://www.finanse-firmy.pl/popup_subskrypcja.html");
// }	
	}
}

// End -->
