<script>
function OnOff(obj)
{
var
DivOn,
DivOff,
Ctrl;
switch(obj.id)
{
case "RadioGroup1_0" :
{
DivOn="D1";
DivOff="D2";
break;
}
case "RadioGroup1_1" :
{
DivOn="D2";
DivOff="D1";
break;
}
}
if(Ctrl=document.getElementById(DivOn))
Ctrl.style.display="block";
if(Ctrl=document.getElementById(DivOff))
Ctrl.style.display="none";
}
function setCookie( name, value, expires, path, domain, secure ) {
var today = new Date();
today.setTime( today.getTime() );
if ( expires ) {
expires = expires * 1000 * 60 * 60 * 24;
}
var expires_date = new Date( today.getTime() + (expires) );
document.cookie = name+'='+escape( value ) +
( ( expires ) ? ';expires='+expires_date.toGMTString() : '' ) + //expires.toGMTString()
( ( path ) ? ';path=' + path : '' ) +
( ( domain ) ? ';domain=' + domain : '' ) +
( ( secure ) ? ';secure' : '' );
}
function getCookie( name ) {
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) && ( name != document.cookie.substring( 0, name.length ) ) ) {
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ';', len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}
</script>
<label><input type="radio" name="Radio1" value="1" id="RadioGroup1_0" onclick="OnOff(this);" />Переключатель1</label>
<label><input type="radio" name="Radio1" value="2" id="RadioGroup1_1" onclick="OnOff(this);" />Переключатель2</label>
<div id="D1"></div>
<div id="D2" style="display: none></div> |