jQuery(document).ready(function() {

	jQuery('#subscriber_email').click(function(){
		if ( jQuery(this).hasClass("unfocus") )
			 jQuery(this).attr('value', '').removeClass("unfocus")
	})
	
	jQuery('#sbm_newsletter').click(function(){
		var val = jQuery('#subscriber_email').val();
		if( val.match(/^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$/g) )
			return true;
		alert('Neteisingai nurodytas paštas')
		return false;		
	})
})

function ShowImage(src, width, height, no) {
	
	var max = 800
	if( width > max ) {
		height = Math.round(max / (width / height))
		width = max
	}
	var top = Math.floor((screen.availHeight-height)/2)-(screen.height-screen.availHeight);
    var left = Math.floor((screen.availWidth-width)/2)-(screen.width-screen.availWidth);
	var attributes = 'top='+top+',left='+left+',scrollbars=no,menubar=no,height='+(height)+',width='+(width)+',resizable=no,toolbar=no,location=no,status=no';
	var loadImage = window.open('http://projektai.etalink.lt/flylalgroups_service/photoPreview.php?src=' + src + '&width='+width+'&height='+height+'&no='+no,'loadImage',attributes);
	 
	//loadImage.document.write('<html><head><title></title></head><body style="background:#000000;margin:0">');
	//loadImage.document.write('<div style="background:#FFF; position:absolute;top:5px; right: 5px; padding: 4px 4px 0 4px; background: #F1F1F1; border:#E3E3E3;-moz-opacity:.90; filter:alpha(opacity=90); opacity:.90;"><a href="http://corp.finhill.lt/download.php?source='+src+'" id="download_image" title="Išsaugoti"><img src="http://corp.finhill.lt/images/download.gif" alt="parsisiųsti" border="0" /></a>&nbsp;&nbsp;<a href="javascript:void(0)" onclick="javascript: window.close()" title="Uždaryti"><img src="http://corp.finhill.lt/images/close.gif" alt="uždaryti" border="0" /></a></div>');
	//loadImage.document.write('<img src="'+src+'" style="width:'+ width + '; height:' + height + '" />');
	//loadImage.document.write('</body></html>');
	 
}
function showVideo(id)
{
    mywindow = window.open ("/video.php?id="+id, "mywindow","location=1,status=1,scrollbars=1,  width=550,height=550");
    mywindow.moveTo(0,0);
} 