$.fn.cycle.transitions.pinch = function($cont, $slides, opts) { 
    var $el = $($slides[0]); 
    var w = $el.width(); 
    var h = $el.height(); 
    opts.cssBefore = { top: 0, left: 0, width: 0, height: 0, zIndex: 1 }; 
    opts.animIn    = { width: w, height: h }; 
    opts.animOut   = { top: h, left: w, width: 0, height: 0 }; 
    opts.cssAfter  = { zIndex: 0 }; 
};

$(document).ready(function(){
// Form element focus/blur logic
	$('div.frow input,div.frow textarea').each(function(){
		$(this).css($(this).attr('title') == $(this).val() ? {color:'#A5CF5A'} : {color:'#000000'});
	});
	$('div.frow input,div.frow textarea,#kw').focus(function(){
		$(this).css({color:'#000000'});
		if($(this).attr('title') == $(this).val()){
			$(this).val('');
		}else{
			$(this).val($(this).val());
		}
	});
	$('div.frow input,div.frow textarea,#kw').blur(function(){
		if($(this).val() == ''){
			$(this).val($(this).attr('title'));
			$(this).css({color:'#A5CF5A'});
		}else{
			$(this).val($(this).val());
			$(this).css({color:'#000000'});
		}
	});
	
	$('#slidego').click(function(){
		var bgimg = $('#slider').css('display') == 'none' ? 'url(/images/arrowu.gif)' : 'url(/images/arrowd.gif)';
		$('#slidego').css({backgroundImage:bgimg});
		$('#slider').slideToggle();
	});

	$('#rotator').cycle({ 
	    fx: 'pinch', 
	    delay: 2000 
	});
});
