function f_select(fl) {
	inputs = document.getElementsByTagName('input');
	for (i = 1; i < inputs.length; i++){
		if (inputs[i].type=='checkbox') {
			inputs[i].checked = fl;
		}
	}
	return;
}
function my_popup(src, width, height,title) {
	popup_w=window.open("about:blank", "_blank", "width="+(width+20)+", height="+(height+20));
	popup_w.document.write("<html><head><title>"+title+"</title><link rel='stylesheet' type='text/css' href='/css/layout.css' /><link rel='stylesheet' type='text/css' href='/css/common.css' /></head><body>");
	popup_w.document.write("<img class='image' src="+src+" width='"+width+"' height='"+height+"' alt='"+title+"' title='Карта проезда'>");
	popup_w.document.write("</body></html>");
}

function flash(version, filename, name, width, height, wmode, bgcolor, menu, flashvars, salign) {
	salign==false ? salign="lt":"";
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+width+'" height="'+height+'" id="'+name+'" align="middle">');
	document.write('<param name="allowScriptAccess" value="sameDomain"/>');
	document.write('<param name="allowFullScreen" value="true"/>');
	document.write('<param name="wmode" value="'+wmode+'"/>');
	document.write('<param name="bgcolor" value="'+bgcolor+'"/>');
	document.write('<param name="salign" value="'+salign+'"/>');
	document.write('<param name="movie" value="'+filename+'"/>');
	document.write('<param name="menu" value="'+menu+'"/>');
	document.write('<param name="quality" value="high"/>');
	document.write('<param name="flashvars" value="'+flashvars+'"/>');
	document.write('<embed src="'+filename+'" wmode="'+wmode+'" menu="'+menu+'" quality="high" flashvars="'+flashvars+'" salign="'+salign+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+name+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>');
	document.write('</object>');
	return true;
}

function flash_innerHTML(version, filename, name, width, height, wmode, bgcolor, menu, flashvars, salign) {
	salign==false ? salign="lt":"";
	htmlText='<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version='+version+'" width="'+width+'" height="'+height+'" id="'+name+'" align="middle">'
	+'<param name="allowScriptAccess" value="sameDomain"/>'
	+'<param name="allowFullScreen" value="true"/>'
	+'<param name="wmode" value="'+wmode+'"/>'
	+'<param name="bgcolor" value="'+bgcolor+'"/>'
	+'<param name="salign" value="'+salign+'"/>'
	+'<param name="movie" value="'+filename+'"/>'
	+'<param name="menu" value="'+menu+'"/>'
	+'<param name="quality" value="high"/>'
	+'<param name="flashvars" value="'+flashvars+'"/>'
	+'<embed src="'+filename+'" wmode="'+wmode+'" menu="'+menu+'" quality="high" flashvars="'+flashvars+'" salign="'+salign+'" width="'+width+'" height="'+height+'" bgcolor="'+bgcolor+'" name="'+name+'" align="middle" allowScriptAccess="sameDomain" allowFullScreen="true" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"/>'
	+'</object>';
	return htmlText;
}

function email(name, domain, tld, text, subject) {
	if(subject) {
	} else {
		subject="Mail from site";
	}
	if(text) {
		if(subject) {
			document.write('<a href="mailto:'+name+'@'+domain+'.'+tld+'?Subject='+subject+'">'+text+'</a>');
		} else {
		}
	} else {
		document.write('<a href="mailto:'+name+'@'+domain+'.'+tld+'?Subject='+subject+'">'+name+'@'+domain+'.'+tld+'</a>');
	}
	return true;
}
