function openPopupImage(img_url, w, h, img_title, nonAutoClose, low_src, stripped_comment) {
	JSVer = (navigator.userAgent.indexOf ("Mozilla") != -1 ? parseInt(navigator.appVersion.substring(0,1)) : 0);
	MSIE = (navigator.userAgent.indexOf ("MSIE") != -1);

	var leftPos = (window.screen.width - w)/2;
	var topPos = (window.screen.height - h)/2;

    var r_w = w, r_h = h, s = '', s_scroll = 'no';
    if (JSVer >= 3) {
        if (JSVer == 3) {
            r_w += 32; r_h += 32;
        }
        if (img_title)  r_h += 18;
        if (screen) {
            if (screen.availWidth < r_w) {
                s_scroll = 'yes';
                r_w = screen.availWidth;
            }
            if (screen.availHeight < r_h) {
                s_scroll = 'yes';
                r_h = screen.availHeight;
            }
        } else
            s_scroll = 'yes';
        s = 'status=no,resizable=yes,scrollbars=' + s_scroll + ',width=' + r_w + ',height=' + r_h + ',left=' + leftPos + ',top=' + topPos ;
        var secWnd = window.open('', 'SecondWnd', s);
        with (secWnd) {
            document.write("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\">\n");
            document.write("<html>\n");
            document.write("<head>\n");
            document.write("<title></title>\n");
            document.write("<meta http-equiv=\"content-type\" content=\"text/html; charset=windows-1251\">\n");
            document.write("<style>\n");
            document.write("P {margin:0px; margin-bottom: -50px; margin-top: 20px;padding:0px;}\n");
            document.write("body {margin: 0px; padding: 0px; text-align: center;}\n");
            document.write("img {border: none;}\n");
            document.write("</style>\n");
            document.write("</head>\n");
            document.write("<body>");
            if (JSVer >= 4 || MSIE) {
//                document.write("<div>");
            }
            document.write("<img src=\""+img_url+"\" " + (low_src != null ? (" lowsrc=" + low_src) : '') + " border=0>");
            if ((img_title != null) && (img_title != "")) {
                if (JSVer >= 4)
                    document.write("<p>");
                else
                    document.write("<p>");
                document.writeln(img_title);
                if (JSVer >= 4)
                    document.write("</p>");
                else
                    document.writeln("</p>");
            }
            if (JSVer >= 4 || MSIE) {
//               document.write("</div>\n");
            }
            document.writeln("</body>\n</html>");
            document.close();
        }
        return false;
    }
    return false;
}

function GoPopupWindow(url, w, h, theTitle ) {

	var leftPos = (window.screen.width - w)/2;
	var topPos = (window.screen.height - h)/2;

	if(theTitle.length ==0) theTitle = '+';

	s = 'status=no,scrollbars=yes' + ',width=' + w + ',height=' + h + ',left=' + leftPos + ',top=' + topPos ;

	var secWnd = window.open(url, 'LargePicWindow' + w, s);

	with (secWnd) {

		document.write("<html>\n<head><title>" + theTitle + "</title>");
		document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/include/popupstyle.css\" >");
		document.write("</head>");
        document.write("<body");
        document.write("<div>");
        document.write("<img src=\""+url+"\" style='width: "+w+"px; height: "+h+"px; border: none;'>");
        document.write("</div>");
        document.close();
		focus();
    }
    return false;
}

function openImageWindow(url, w, h) {

	var leftPos = (window.screen.width - w)/2;
	var topPos = (window.screen.height - h)/2;

	s = 'status=no,scrollbars=yes' + ',width=' + w + ',height=' + h + ',left=' + leftPos + ',top=' + topPos ;

	var secWnd = window.open(url, 'LargePicWindow' +w +h, s);

	with (secWnd) {
		focus();
    }
    return false;
}



	function xget(id, doc) {
		if(!doc) doc=document;
		if(doc.getElementById) return doc.getElementById(id);
		else if(doc.all) return doc.all[id];
		return null;
	}
	
	

function CheckSubmit(){
		bCompl = true;
		

		var strMessage = 'Following fields are required to complete form:\n';

		var fio = xget('form_fio'); 
		var birthyear = xget('form_birthyear'); 

		var email = xget('form_email'); 
		var email2 = xget('form_email2'); 

		var zcode = xget('form_zcode'); 
		var homeaddress = xget('form_homeaddress'); 

		var phone = xget('form_tel'); 


		if(fio.value.length == 0){
			bCompl = false;
			strMessage += '[Name]\n';
		}


		if(birthyear.value.length == 0){
			bCompl = false;
			strMessage += '[Birth year ]\n';
		}
		
		if(email.value.length == 0){
			bCompl = false;
			strMessage += '[email]\n';
		}
		if(email2.value.length == 0){
			bCompl = false;
			strMessage += '[email-reconfirm]\n';
		}
		
		if( ( email2.value < email.value )||( email2.value > email.value )) {
			bCompl = false;
			strMessage += '[email address does not match confirmation]\n';
		}
		
		
		if(zcode.value.length == 0){
			bCompl = false;
			strMessage += '[Postal code]\n';
		}
		if(homeaddress.value.length == 0){
			bCompl = false;
			strMessage += '[Home address]\n';
		}

		if(phone.value.length == 0){
			bCompl = false;
			strMessage += '[Tel number]\n';
		}
		

	
		if(!bCompl){	
			alert(strMessage);
			return bCompl;
		} else {
		
			oForm.submit();
		}	
		return false;	
	}
	
	