function refreshVerImg(imgid){
	var currentTime = new Date();
	document.getElementById(imgid).src = 'includes/captcha.php?' + currentTime.getTime();
}

/* ===== Fix transparency problems in IE =====*/
/*$(document).ready(function() {
	$('img[@src$=.png]').ifixpng(); 
});*/
/* ===== END Fix transparency problems in IE =====*/

$(document).ready(function() {
	var target = $('.boxMeniu');
	$(target).hover(function(){
		$(this).find('.transparenta').fadeIn('fast');
	}, function() {
		$(this).find('.transparenta').fadeOut('slow');
	});
});

$(document).ready(function() {

	/* ===== Rounded Corners =====*/
	$('div.roundedTop').corner("top 15px");

	$('.roundedLeft').curvycorner({
		tl: { radius: 8 },
		tr: false,
		bl: { radius: 8 },
		br: false,
		antiAlias: true,
		autoPad: true,
		validTags: ["div"]
	});
	
	$('.roundedAll').curvycorner({
		tl: { radius: 13 },
		tr: { radius: 13 },
		bl: { radius: 13 },
		br: { radius: 13 },
		antiAlias: true,
		autoPad: true,
		validTags: ["div","a"]
	});
	/* ===== END Rounded Corners =====*/

});

/* ===== Smooth scroll =====*/
/*$(document).ready(function() {
	$('a.smooth-scroll').bind('click', function(){
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
			if ($target.length) {
				var targetOffset = $target.offset().top;
				$('html,body').animate({scrollTop: targetOffset}, 1000);
				return false;
			}
		}
	});
});*/
/* ===== END Smooth scroll =====*/

/* ===== Set input label as value =====*/
$(document).ready(function() {
	var searchLabel = $('#newsletter label').remove().text();
	$('#email').addClass('placeholder').val(searchLabel)
	.focus(function() {
		if (this.value == searchLabel) {
			$(this).removeClass('placeholder').val('');
		};
	}).blur(function() {
		if (this.value == '') {
			$(this).addClass('placeholder').val(searchLabel);
		};
	});
});
/* ===== END Set input label as value =====*/

/* ===== Sending forms with Jquery and Ajax =====*/
function sendForm(form) {
	$(document).ready(function() {
		var options = {
			target:        	'#ajaxresponse',
			beforeSubmit:  	showBefore,
			success:       	showResponse,
			url:  			'includes/post.php',
			type: 			'post'
		};
			
		$('#'+form).submit(function() { 
			$(this).ajaxSubmit(options); 
			return false; 
		}); 
	});

	function showBefore()  {
		document.getElementById('ajaxresponse').style.display = 'block';
		document.getElementById('ajaxresponse').innerHTML = '<div class="success"><img src="images/ajax-loader.gif" align="absmiddle" /> Sending information...</div>';
	}
	function showResponse(result)  {
		document.getElementById('ajaxresponse').style.display = 'block';
		document.getElementById('ajaxresponse').innerHTML = '<div class="success">'+result+'</div>';
		refreshVerImg('imgCaptcha');
	}
}
/* ===== END Sending forms with Jquery and Ajax =====*/

/* ===== Set up the accordion plugin =====*/
$(document).ready(function(){
	$('#navigation').accordion({ 
	    header: 'h2.head',
	    selectedClass : "active",
	    autoheight: false,
	    alwaysOpen: false,
	    active: false
	});
});
/* ===== END Set up the accordion plugin =====*/

/* ===== Set up the tooltip plugin =====*/
$(document).ready(function(){
	$(".boxLogo").tooltip({
		track: true,
		delay: 0,
		showURL: false,
		opacity: 1,
		fixPNG: true,
		showBody: " - ",
		extraClass: "fancy",
		top:-5,
		left: 15
	});
	$(".boxLogo").css({cursor:'pointer'});
});
/* ===== END Set up the tooltip plugin =====*/


$(document).ready(function(){
	$(".leftNavigation li").click(function(){
    	window.location=$(this).find("a").attr("href");
    	return false;
	});
}); //close doc ready

/*$(document).ready(function(){
	$('a.captioned').each(
		function() {
			var target = $(this).find('img');
			var targetWidth = $(target).width();
			$(target)
				.wrap('<div class="imgcontainer" style="width: '+(targetWidth+2)+'px"></div>')
				.after('<div class="caption" style="height:1px;">Click to enlarge</div>');
			
			$(this).hover(function(){
				$(this).find('div.caption').animate({'height':'18px'},'slow');	
			},function(){
				$(this).find('div.caption').animate({'height':'0'},'slow');
			});
				
		}
	);
});*/

