  
$(document).ready(function(){
  $("#subscribe_form").submit(function(){
    var RegExp = /^((([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+(\.([a-z]|[0-9]|!|#|$|%|&|'|\*|\+|\-|\/|=|\?|\^|_|`|\{|\||\}|~)+)*)@((((([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.))*([a-z]|[0-9])([a-z]|[0-9]|\-){0,61}([a-z]|[0-9])\.)[\w]{2,4}|(((([0-9]){1,3}\.){3}([0-9]){1,3}))|(\[((([0-9]){1,3}\.){3}([0-9]){1,3})\])))$/;
    
    if(!$("#subscribe_inp").val() || !RegExp.test($("#subscribe_inp").val())) 
      return false;
  })
});
function zoom(src, w, h) {
	var z_window = window.open('about:blank', z_window, 'left=' + ((screen.width - w)/2) + ',top=' + ((screen.height - h)/2 - 50) + ',width=' + (w+20) + ',height=' + (h+20));
	z_window.document.write('<title>Zoom</title><body style="margin:0px;cursor:pointer;" onClick="window.close()">');
	z_window.document.write('<table width="100%" height="100%"><tr><td align="center" valign="center">');
	z_window.document.write('<img src="' + src + '"></td></tr></table></body>');
	z_window.focus();
}

function show_item(url){
  
   $.blockUI({ message: '<h3>Подождите, идет загрузка...</h3>', overlayCSS: {opacity: '0.1'} });
   $('#itemContainer').load(url, null, function(){
  /* $.unblockUI();*/
   $.blockUI({ message: $("#itemContainer"), overlayCSS: {opacity: '0.3'}});
   $(".blockMsg").css('width', '660px');
   $(".blockMsg").css('top', '15%');
   $(".blockMsg").css('left', '25%');
   $(".blockMsg").css('border', '0px');
   $(".blockMsg").html($("#itemContainer").html());
  });
}

function close_item()
{
  $.unblockUI();
}
  
 // $('#itemContainer').load(url)
 // $('#itemContainer').modal({close:true});


function PopUp(url, width, height) {
	var w = width;
	var h = height;
	var z_window = window.open(url, z_window, 'width=' + (w+20) + ',height=' + (h+80));
	
	z_window.focus();
}

function popup2(url, title, w, h) {
  var width = w;
  var height = h;
  var z_window = window.open(url, '', 'width='+width+',height='+height);
  z_window.document.write('<title>'+ title +'</title><body style="margin:0px;cursor:pointer;" onClick="window.close()">');
	z_window.document.write('<table width="100%" height="100%"><tr><td align="center" valign="center">');
	z_window.document.write('<img src="' + url + '"></td></tr></table></body>');
  z_window.focus();
}

