$(function(){
	$('a.zoom').fancybox({
		'transitionIn'	:	'elastic',
		'transitionOut'	:	'elastic',
		'speedIn'		:	600, 
		'speedOut'		:	200, 
		'overlayShow'	:	true
	});
	
	$('form').submit(function(){
		var $this = $(this)
		$this.find('.buttons').addClass('load')
		$.post(
			'/ajax' + $this.attr('action'),
			$this.serializeArray(),
			function(data){
				$this.find('.result').html(data)
				.siblings('.buttons').removeClass('load')
			}
		)
		return false
	})
	
	
	//$('.file a').each(function(){
		//$(this).attr('href', escape($(this).attr('href')))
	//})
	
	
	// Player
	flowplayer("player", "/design/swf/flowplayer-3.2.7.swf", {
		// configure clip to use "lighthttpd" plugin for providing video data
		clip: {
			autoPlay: false,
			url: 'http://rgups.ru/video/rgups.mp4',
			provider: 'lighttpd'
		},
	
		// streaming plugins are configured normally under the plugins node
		plugins: {
			lighttpd: {
				url: '/design/swf/flowplayer.pseudostreaming-3.2.7.swf'
			}
		}
	});
})



function open_swf(nam, w, h)
{
   window.open('swf_win/show.php?nam='+nam ,'swf','height='+h+', width='+w+', toolbar=0, location=0, directories=0, status=0, menubar=0, scrollbars=0, resizable=0');
}
function refresh(url){
   if (url){
	 document.location.href=url;
   }
}


function resizep() {
	var w, h;
	w = document.images[0].width;
	h = document.images[0].height;
	window.resizeTo(w+50, h+110);
}


function showp() {
	document.images[0].src = location.search.substring(1);
}


function openw(res) {
var z = res.src;
z = z.substring(0, z.length-5)+z.substring(z.length - 4);
window.open("picview.htm?"+z, null, "top=20, left=40, channelmode=no, toolbar=no, location=no, directories=no, menubar=no, scrollbars=1");}


function handset() {
n = document.images.length;
for (i=0; i<n; i++)
  {if (document.images[i].onClick != '')
	  {document.images[i].style.cursor = 'hand';}}
}
