

window.onload = function()
{
// 	document.getElementById(''

	// first check
	ilist = document.getElementsByTagName('input');

// 	el = document.forms.orderquick.use_ship_address[0];
// 	if( el.checked )
// 	{
// 		id=el.name+'_switch';
// 		if( switch_el = document.getElementById(id) )
// 		{
// 			switch_el.style.display='none';
// 		}
// 	}

// 	ellist = document.forms.orderquick.use_ship_address;
	// set switch functions
	if( ilist.length >0 )
	{
		var first_checked = false;
		for( i=0;i<ilist.length;i++)
		{
			el = ilist[i];
			if( el.name == 'use_ship_address' )
			{
				// check first
				el.onclick =
				function ()
				{
					id=this.name+'_switch';
					if( switch_el = document.getElementById(id) ){
						switch_el.style.display=(1==this.value)?'none':'block';
					}
				};
				if( false==first_checked )
				{
					first_checked = true;
// 					alert('first_checked '+el.value);
					if( el.checked )
	 				{
						id=el.name+'_switch';
						if( switch_el = document.getElementById(id) )
						{
							switch_el.style.display='none';
						}
					}
				}
				/*if( ilist instanceof NodeList )
				{
					for(j=ilist.length-1;j>=0;j--)
					{
						ilist.item(j).onclick =
							function ()
							{
// 								alert('switch '+(this.id)+' '+this.value);
								id=this.name+'_switch';
								if( switch_el = document.getElementById(id) )
									switch_el.style.display=(1==this.value)?'none':'block';
							};
					}
				}*/
			}
		}
	}
	else
	{
		alert('No targets');
	}
}

