$(function(){
	//validate
	$(".validate").each(function(){
		$(this).validate({errorElement: 'span'});
	});
	
	//Corner
	//$(".corner").corner("15px");
	
	//Tabs
	$('#infosBox').children('.tab').hide().eq(0).show();
	$("#infosBoxHeader a").click(function(){
		$('#infosBox').children('.tab').hide();
		$("#"+$(this).attr("href").replace("#", "")).fadeIn("slow");
		$(this).blur();
		return false;
	});
	
	//form
	$('#SearchAddForm .submit').parent().append($('#SearchAddForm .submit').html()).find('.submit').remove();
	
	//png
	$('img[@src$=.png]').ifixpng();
});

function getIdFromUrl(url){
	return url.substring((url.lastIndexOf('/') + 1));
}
function openVideo(id){

/*	$('#mainVideo').flash(
		{ 
			width: 500,
			height: 380,
			src: '/images/gallery/video/flvplayer.swf',
			quality: 'high',
			pluginspage: 'http://www.macromedia.com/go/getflashplayer',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			flashvars: {
				file: '/images/gallery/video/qvc/'+id,
				displayheight:360,
				autostart: true,
				smoothing: true
			}
		},
		{update:true}

	); */
    
    
    $('#mainVideo').flash(
		{ 
			width: 500,
			height: 380,
			src: id,
			quality: 'high',
			pluginspage: 'http://www.macromedia.com/go/getflashplayer',
			allowfullscreen: 'true',
			allowscriptaccess: 'always',
			flashvars: {
                displayheight:360,
				autostart: true,
                autoPlay:true,
				smoothing: true
			}
		},
		{update:true}

	);
}


