function check_if_email_valid(email_field,msg){
var pattern = /^[a-zA-Z_\.-][a-zA-Z0-9_\.-]+\@[a-zA-Z\.-]+\.[a-zA-Z]{2,4}$/;
	if (pattern.test(email_field.value)){
		return true;
	} else {
		alert(msg);
		email_field.focus();
		email_field.select();
		return false;
	}		
}

function check_if_integer(text){
var pattern = /\D/;
if (pattern.test(text)){return false;} else {return true;} 	
}

function show_big_picture(img,img_x,img_y,window_title,msg,bgr_color){
var win_x = eval(parseInt(img_x) + 15); 
var win_y = eval(parseInt(img_y) + 15);
var tab_y = img_y + 15;
new_win = open("", "displayWindow","width=" + 600 + ",height=" + 700 + ",resizable=yes,status=no,toolbar=no,menubar=no,scrollbars=yes");
new_win.document.open();
new_win.document.writeln("<html><head><title>"+ window_title +"</title>");
new_win.document.writeln("</head><body bgcolor=\""+ bgr_color +"\" marginwidth=5 leftmargin=5 marginheight=5 topmargin=5>"); 
new_win.document.writeln("<a href=\"javascript:window.close()\"><img src=\"" + img + "\" alt=" + msg + " width=" + img_x + " height=" + img_y + "vspace=2 border=0>");
//new_win.document.writeln("<div align=\"center\"><a href=\"javascript:window.print()\">[Print]</a></div>");
//new_win.document.writeln("<div align=\"center\"><a href=\"javascript:window.close()\">Закрыть</a></div>");
new_win.document.writeln("</body></html>"); 
new_win.document.close();
new_win.focus();
} 

function show_big_picture_fixed(img,img_x,img_y,window_title,msg,bgr_color){
var win_x = eval(parseInt(img_x) + 15); 
var win_y = eval(parseInt(img_y) + 15);
var tab_y = img_y + 15;
new_win = open("", "displayWindow","width=" + win_x + ",height=" + win_y + ",status=no,toolbar=no,menubar=no");
new_win.document.open();
new_win.document.writeln("<html><head><title>"+ window_title +"</title>");
new_win.document.writeln("</head><body bgcolor=\""+ bgr_color +"\" marginwidth=5 leftmargin=5 marginheight=5 topmargin=5>"); 
new_win.document.writeln("<a href=\"javascript:window.close()\"><img src=\"" + img + "\" alt=" + msg + " width=" + img_x + " height=" + img_y + "vspace=2 border=0>");
//new_win.document.writeln("<div align=\"center\"><a href=\"javascript:window.print()\">[Print]</a></div>");
//new_win.document.writeln("<div align=\"center\"><a href=\"javascript:window.close()\">Закрыть</a></div>");
new_win.document.writeln("</body></html>"); 
new_win.document.close();
new_win.focus();
} 

function show_flash(flash,flash_x,flash_y,window_title,msg,bgr_color){
var win_x = eval(parseInt(flash_x) + 8); 
var win_y = eval(parseInt(flash_y) + 8);
var tab_y = flash_y + 5;
new_win = open("", "displayWindow","width=" + win_x + ",height=" + win_y + ",status=no,toolbar=no,menubar=no");
new_win.document.open();
new_win.document.writeln("<html><head><title>"+ window_title +"</title>");
new_win.document.writeln("</head><body bgcolor=\""+ bgr_color +"\" marginwidth=5 leftmargin=5 marginheight=5 topmargin=5>"); 
new_win.document.writeln("<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0\" width=\""+flash_x+"\" height=\""+flash_y+"\">");
new_win.document.writeln("<param name=\"movie\" value=\""+flash+"\">");
new_win.document.writeln("<param name=\"quality\" value=\"high\">");
new_win.document.writeln("<embed src=\""+flash+"\" quality=\"high\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\" width=\""+flash_x+"\" height=\""+flash_y+"\"></embed>");
new_win.document.writeln("</object>");
//new_win.document.writeln("<div align=\"center\"><a href=\"javascript:window.print()\">[Print]</a></div>");
//new_win.document.writeln("<div align=\"center\"><a href=\"javascript:window.close()\">Закрыть</a></div>");
new_win.document.writeln("</body></html>"); 
new_win.document.close();
new_win.focus();
}
