searchtext = function()
{
	var box = ($(".gsc-input").html() != null) ? $(".gsc-input") : $('input[name=q]');
	box.focus( function() { if(box.val() == 'search') { box.val(''); } });	
	box.blur(function(){ if(box.val() == '') { box.val('search'); } });	
};

showFull = function(id) {
	$("#abstract_" + id).toggle();
	$("#abstract_" + id + "_full").toggle();
};

switchDisplay = function ()
{
	$("a#english").click(function () { 
      $("#pageLeft").css('width', '100%').show();
      $("#pageRight").hide();
    });
    
	$("a#serbian").click(function () { 
      $("#pageLeft").hide();
      $("#pageRight").css('width', '100%').show();
    });
    
    $("#both").click( function()
    {
      $("#pageLeft").css('width', '48%').show();
      $("#pageRight").css('width', '48%').show();
    });
};

var app = {
	tooDark: function() {
		if ($('#energySavingPolicy').html() != '')		{ return $('#energySavingPolicy').fadeIn(1000); }
		$('#energySavingPolicy').load(HOMEPAGE + '/ajax/toodark').fadeIn(1000);
	}
}

$(document).ready(function() {
	searchtext();
	switchDisplay();
	$("a[class='colorbox']").colorbox({slideshow:true});
	$("a[class='videobox']").colorbox({iframe:true, innerWidth:425, innerHeight:344});
});
