function isEmailCorrect(formname, fieldname) { 
	var re = /^\w+([\.-]?\w+)*@(((([a-z0-9]{2,})|([a-z0-9][-][a-z0-9]+))[\.][a-z0-9])|([a-z0-9]+[-]?))+[a-z0-9]+\.([a-z]{2}|(com|net|org|edu|int|mil|gov|arpa|biz|aero|name|coop|info|pro|museum))$/i;
	if(re.test(eval("document.forms['"+formname+"']."+fieldname+".value"))) return true;
	else {
		alert("Email is incorrect!");
		eval("document.forms['"+formname+"']."+fieldname+".focus()");
		return false; 
	} 
}
function email (login, sc)
{
 	var serv = new Array;
	serv['m'] = "mail.ru";
	serv['r'] = "rambler.ru";
	serv['y'] = "yandex.ru";
	serv['g'] = "gmail.com";
	serv['b'] = "bila-vorona.com"
	eml = login +  "@" + serv[sc];
	return eml;
}

function mylo (login, sc)
{
document.write (email(login, sc));
}

function namylo (login, sc, sub)
{
eml = "mailto:" + email(login, sc);
if (sub != "") eml += "?subject=" + sub;
window.location.href = eml;
}
//==================  cookie

function set_cookie(name, value, expires, path, domain, secure) {
if(!expires){ expires = new Date(); //   
 expires.setTime(expires.getTime() + (1000 * 86400 * 365)); //    cookie
}
document.cookie = 
name +"=" + escape(value) +
((expires) ? "; expires=" + expires.toGMTString() : "") +
((path) ? "; path=" + path : "") +
((domain) ? "; domain=" + domain : "") +
((secure) ? "; secure" : "")
return true;
}

function initChecklist() {
			if (document.all && document.getElementById) {
				// Get all unordered lists
				var lists = document.getElementsByTagName("ul");
				
				for (i = 0; i < lists.length; i++) {
					var theList = lists[i];
					
					// Only work with those having the class "checklist"
					if (theList.className.indexOf("checklist") > -1) {
						var labels = theList.getElementsByTagName("label");
						
						// Assign event handlers to labels within
						for (var j = 0; j < labels.length; j++) {
							var theLabel = labels[j];
							theLabel.onmouseover = function() { this.className += " hover"; };
							theLabel.onmouseout = function() { this.className = this.className.replace(" hover", ""); };
						}
					}
				}
			}
		}

function toggleById(id)
    {$("#"+id).toggle(500);} 

