function fbs_click(url) {
	u=location.href;
	t=document.title;
	window.open('http://www.facebook.com/sharer.php?u='+encodeURIComponent(url)+'&t='+encodeURIComponent(t),'sharer','toolbar=0,status=0,width=626,height=436');
	return false;
}


/*
 * Nastavi poziciu pagera tak, aby bol vzdy uplne na konci contentu
 */
function movePager() {
        if ($('pager-3')) {
            var contentHeight = $('pager-3').up(1).getHeight();
            var fromContentTop = $('pager-3').up(0).cumulativeOffset()[1] - $('pager-3').up(1).cumulativeOffset()[1];
            if ($("right-column")) {	
            	var rightColumnHeight = $("right-column").getHeight();
            } else {
            	var rightColumnHeight = 200;
            }
            
            
            
//            alert("contentHeight: " + contentHeight);
//            alert("rightColumnHeight: " + rightColumnHeight);
            //alert($('pager-3').up(0).cumulativeOffset()[1]);
            
            if ((rightColumnHeight) > (contentHeight)) {
	            if ((fromContentTop + 28) < contentHeight ) {
	                $('pager-3').up(0).absolutize();
	                $('pager-3').up(0).setStyle({'top': (contentHeight - 28) + 'px'});
	                //$('pager-3').up(0).removeStyle({'top'});
	                $('pager-3').up(0).setStyle({'height': '26px'});
	            }
            } else {
            	$('pager-3').up(0).setStyle({'position':'static'});
            	
            }
        }
    }

/*
 * ak su prave boxiky dlhsie ako obsah, tak obsah natiahnem dole
 */
function setContentHeight() {
	if ($("right-column")) {
        var rightColumnHeight = $("right-column").getHeight();
        var contentHeight = $("content").getHeight();
        if (rightColumnHeight > contentHeight) {
            rightColumnHeight -= 17;
            $("content").setStyle({minHeight:rightColumnHeight + 'px' });
        }
    }
}

function setRelatedLinksHeight() {
	if ($("related-links")) {
	    var height = $("related-links").getHeight();
	    //alert("height: " + height);
	    var top = $("related-links").cumulativeOffset()[1];
	    //alert("top: " + top);
	    var contentHeight = $("related-links").up(0).getHeight();
	    //alert("contentHeight: " + contentHeight );
	    var contentTop = $("related-links").up(0).cumulativeOffset()[1];
	    //alert("contentTop: " + contentTop);
	    var diff = top - contentTop;
	    //alert("diff: " + diff);
	    var newHeight = contentHeight - diff;
	    var newHeightWithoutPaddingAndBorder = newHeight - 51;  
	    //alert("newHeight: " + newHeight);
	    if (height < newHeight) $("related-links").setStyle({'height': newHeightWithoutPaddingAndBorder + 'px'});
	}
}

//dateFuture = new Date(2010,3,15,11,52,0);
//dateFuture  = new Date("June 12, 2010 09:00:00");





function GetCount2(){
	
	var amount = realAmount;
	realAmount = realAmount - 1;

	// time is already past
	if(amount < 0){
		document.getElementById('countbox2').innerHTML="Voľby už začali!";
	}
	// date is still good
	else{
		out = "<div class=\"title\"></div>";
		days=0;hours=0;mins=0;secs=0;//out="";

		//amount = Math.floor(amount/1000);//kill the "milliseconds" so just secs

		days=Math.floor(amount/86400);//days
		amount=amount%86400;

		hours=Math.floor(amount/3600);//hours
		amount=amount%3600;

		mins=Math.floor(amount/60);//minutes
		amount=amount%60;

		secs=Math.floor(amount);//seconds

		//if(days != 0){out += days +" dní"+((days!=1)?"s":"")+", ";}
		
		var days1 = Math.floor(days / 10);
		var days2 = days % 10;
		
		var hours1 = Math.floor(hours / 10);
		var hours2 = hours % 10;
		
		var mins1 = Math.floor(mins / 10);
		var mins2 = mins % 10;
		
		
		
		out += "<div class=\"number\">" + days1 + "</div>";
		out += "<div class=\"number\">" + days2 + "</div>";
		out += "<div class=\"cd-dni\"></div>";
		
		out += "<div class=\"number\">" + hours1 + "</div>";
		out += "<div class=\"number\">" + hours2 + "</div>";
		out += "<div class=\"cd-hod\"></div>";
		
		out += "<div class=\"number\">" + mins1 + "</div>";
		out += "<div class=\"number\">" + mins2 + "</div>";
		out += "<div class=\"cd-min\"></div>";
		
		document.getElementById('countbox2').innerHTML=out;
		
//		if(days != 0) {
//			if (days == 1) out += "<span>" + days + "</span> deň &nbsp;&nbsp;";
//			else			out += "<span>" + days + "</span> dní &nbsp;&nbsp;";
//		}
//		if(days != 0 || hours != 0) {  //{out += hours +" hour"+((hours!=1)?"s":"")+", ";}
//			if (hours == 1) out += "<span>" + hours + "</span> hodina &nbsp;&nbsp;";
//			if (hours >= 2 && hours <= 4) out += "<span>" + hours + "</span> hodiny &nbsp;&nbsp;";
//			if (hours == 0 || hours >= 5) out += "<span>" + hours + "</span> hodín &nbsp;&nbsp;";
//		}
//		if(days != 0 || hours != 0 || mins != 0) { //{out += mins +" minute"+((mins!=1)?"s":"")+", ";}
//			if (mins == 1) out += "<span>" + mins + "</span> minúta &nbsp;&nbsp;";
//			if (mins >= 2 && mins <= 4) out += "<span>" + mins + "</span> minúty &nbsp;&nbsp;";
//			if (mins == 0 || mins >= 5) out += "<span>" + hours + "</span> minút &nbsp;&nbsp;";
//		}
//		if (secs == 1) out += "<span>" + secs + "</span> sekunda";
//		if (secs >=2 && secs <= 4) out += "<span>" + secs + "</span> sekundy";
//		if (secs == 0 || secs >= 5) out += "<span>" + secs + "</span> sekúnd";
////		out += secs +" seconds";
//		document.getElementById('countbox2').innerHTML=out;

		//setTimeout("GetCount()", 1000);
	}
}

//setInterval("GetCount2()", 1000);
//window.onload=GetCount2;
