$(function() {
	$("#s-wrap").jCarouselLite({
      btnNext: "#s-next",
      btnPrev: "#s-prev",
			visible: 5
    });
	
	$("#gs-wrap").jCarouselLite({
      btnNext: "#g-next",
      btnPrev: "#g-prev",
			vertical: true,
			scroll: 1
    });
	
  $("#gs-wrap a").click(function() {
  	$("#gs-wrap li").removeClass("act");
  	$(this).parent().addClass("act");
  });
});

function preload(arrayOfImages) {
  $(arrayOfImages).each(function(){
    // $('<img/>')[0].src = this;
    // Alternatively you could use:
    (new Image()).src = this;
  });
}

function openscr(){
	$('#alink').hide();
	$('#adiv').show();
}
		
function closediv(){
	$('#alink').show();
	$('#adiv').hide();
}

function show_popup(url) {
    $('#popup, #overlay').show();
    $('#popup, #overlay').animate();
    
    $.ajax({
    	type: "post",
    	url: "/addon/values.php",
    	data: {alias:url},
    	success: function(data, textResponse){
    		$("#pop-content").html(data);
    	},
    	error: function(XMLHttpRequest, textStatus, errorThrown){
    		alert(XMLHttpRequest.responseText);
    	}
    });
    
    return false;
}

function clear_popup() {
    $('#popup, #overlay').hide();
    $("#pop-content").html('');
}
