﻿function showClock()
{
	setInterval("setClock()",1000);
	
}
function setClock()
{
var d = new Date();
var hh = d.getHours();
var mm = d.getMinutes();
var ss = d.getSeconds();
var saat = document.getElementById('clock');
if(ss<10)
ss = "0"+ss;
if(mm<10)
mm = "0"+mm;
if(hh<10)
hh = "0"+hh;
saat.innerHTML = hh+":"+mm+":"+ss;
}

	$(function(){
		
	    $("#poll").animate({opacity:'show'},'slow');
		$("#poll_ajax").load("poll/init_poll.php?sid="+Math.random());
		$("#login").css({'right':'27%','top':'0px'});
		$(".add_item").click(function(){
						$(this).hide('slow');
						});
		$(".home_list li a").hover(function(){
								$(this).animate({ paddingLeft: '15px'}, 150);
								});
		$(".home_list li a").mouseout(function(){
								$(this).animate({ paddingLeft: '0px' }, 150);
								});

		$("#search").focus(function(){
								$(this).animate({ width: '450px'}, 150);
								});
		$("#search").blur(function(){
								$(this).animate({ width: '250px' }, 150);
								}); 
		$("#login_btn").click(function(){
									   $(this).hide();
									   $(".login").animate({opacity:'show'},'fast');
									   });
		$("#cancel").click(function(){
									   $("#login_btn").show();
									   $(".login").animate({opacity:'hide'},'fast');
									   });
				$("#main-content").animate({height: 'show'},'slow');

				
				$("ul.dropdown").parent().addClass("btn");
				
				$("ul.nav li.btn").hover(function() { 
					$(this).find("ul.dropdown").animate({opacity: '0.9', height: 'show'},'fast');
				}, function(){
					$(this).find("ul.dropdown").animate({opacity: 'hide', height: 'hide'},100);
				}); 
		}); 
	
$(document).ready(function() {
    $('.slideshow').cycle({
    fx:    'scrollLeft', 
    delay: -1000 
	});
$('#ap').cycle();
});
function init_poll(){             
    $("#poll_ajax").load("poll/init_poll.php?sid="+Math.random()); 
}

function vote(value){
	$(document).ready(function(){
		var response = $.ajax({ type: "GET",   
                          url : "poll/vote_poll.php?votefor="+value,   
                        async : false
               });

	});
	results();
}
function results(){
	$("#poll_ajax").load("poll/results_poll.php?sid="+Math.random());
}
var browserName = navigator.appName;
var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var is_safari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
var is_opera = navigator.userAgent.toLowerCase().indexOf('opera') > -1;

if(is_chrome){
	$("body").css({'position':'absolute','top':'0px','bottom':'0px','right':'0px','left':'0px'});
}
/*****Log*****/
function createLog(){
	var browserName = navigator.appName;
	var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
	var is_safari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;
	var is_opera = navigator.userAgent.toLowerCase().indexOf('opera') > -1;
	//remove later
	var brwsr = "";
	if(browserName == "Microsoft Internet Explorer")
		brwsr = "Microsoft Internet Explorer";
	else if(is_opera)
		brwsr = "opera";
	else if(is_safari && !is_chrome)
		brwsr = "safari";
	else if(is_chrome)
		brwsr = "chrome";
	else if(navigator.product == 'Gecko')
		brwsr = "Mozilla Firefox";
	else
		brwsr = browserName;
	var urlx = document.location;
/*			$(document).ready(function(){
			var response = $.ajax({ type: "GET",   
							  url : "http://najdioglas.mk/includes/user_info.php?scr_resX="+screen.width+"&scr_resY="+screen.height+"&browser="+brwsr+"&urlx="+urlx,   
							async : false,
						  success : function(resp) {
									//dsad
									}
				   });
	
		});	*/
}
/**********/
