$(document).ready(function() {

	if ($("body").height() < $(window).height()) {
			$("#footer").css("position", "fixed");
			$("#footer").css("bottom", "0");
	}

	$("input[type=text], textarea").each(function() {
		$(this).focus(function() {
			if ($(this).val() == this.defaultValue) {
				$(this).val("");
				$( this ).css( "text-align","right" ); 
				$( this ).css( "direction","rtl" ); 
				}
		});

		$(this).focusout(function() {
			if ($(this).val() == "") {
				$(this).val(this.defaultValue);
				$( this ).css( "text-align","right" ); 
				$( this ).css( "direction","rtl" ); 
				}
		});
	});
	$('#slider').cycle({ 
		fx:     'fade', 
		timeout: 4500, 
		pager:  '#nav',
		pagerAnchorBuilder: function(index, el) {
		return '<a href="#"> </a>';
		}
	});
	var oScroll1 = $('#scrollbar1');
	if(oScroll1.length > 0){
		oScroll1.tinyscrollbar();
	}
	$('#scrollbar1').tinyscrollbar();

	var oScroll1 = $('#scrollbar_album');
	if(oScroll1.length > 0){
		oScroll1.tinyscrollbar();
	}
	$('#scrollbar_album').tinyscrollbar();
	var oScroll1 = $('#scrollbar_gallery');
	if(oScroll1.length > 0){
		oScroll1.tinyscrollbar();
	}
	$('#scrollbar_gallery').tinyscrollbar();

		$("a#big_link").fancybox({
					'transitionIn'	:	'elastic',
					'transitionOut'	:	'elastic',
					'speedIn'		:	600, 
					'speedOut'		:	200, 
					'overlayShow'	:	true
	});
	$("#content_pic a").fancybox({
					'transitionIn'	:	'elastic',
					'transitionOut'	:	'elastic',
					'speedIn'		:	600, 
					'speedOut'		:	200, 
					'overlayShow'	:	true
	});	
});
function changeIt (location,original) {
	// $("#big_src").attr("src",location);
	// $("#big_link").attr("href",location);
	$("#content_pic #big_link img").attr("src", location);
	$("#content_pic a").attr("href", original);
}
