$(function() {
$('.hover_block ').hover(function(){
$(this).find('img').animate({left:'300px'},{queue:false,duration:500});
}, function(){
$(this).find('img').animate({left:'0px'},{queue:false,duration:500});
});
$('ul.hover_block2 li').hover(function(){
$(this).find('img').animate({left:'300px'},{queue:false,duration:500});
}, function(){
$(this).find('img').animate({left:'0px'},{queue:false,duration:500});
});
});


$(function() {
var stack = [];

// preload images into an array
for (var i = 3; i < 9; i++) {
var img = new Image(200,200);
img.src = 'http://fincachicua.com/wp-content/uploads/yapb_cache/image' + i + '.jpg';
if (img.complete)
stack.push(img);
else 
$(img).bind('load', function() {
stack.push(this);
});
} 

// start slideshow
$('#slides').cycle({
speed:  3000, 
delay: -1000,
timeout:  1500, 
random:  1,
before:   onBefore
});

// add images to slideshow
function onBefore(curr, next, opts) {
if (opts.addSlide) // <-- important!
while(stack.length)
opts.addSlide(stack.pop()); 
};
});
window.onload = extLinks;

function extLinks() { 
if (!document.getElementsByTagName) return; 
var anchors = document.getElementsByTagName("a"); 
for (var i=0; i<anchors.length; i++) { 
	var anchor = anchors[i]; 
	if (anchor.getAttribute("href") && 
		anchor.getAttribute("rel") == "external") 
	anchor.onclick = function() {
		extPop(this.href);
		return false;
		}; 
	} 
}

function extPop(url) {
newWin = window.open(url,"_blank","top=0,left=0,height="+screen.availHeight+",width="+screen.availWidth+",location,scrollbars,directories,menubar,resizeable,status,toolbar");
}
$(function(){
$("#wrapper").corner("bottom");
});
$(document).ready(function() {
/* This is basic - uses default settings */
$("a#single_image").fancybox();

});
