// JavaScript Document
function output_normal(imgfile, width, height,style) {
	var version = navigator.userAgent;
	if (version.indexOf('Firefox') == -1) {
		var content = '<img src=\"images/blank.gif\" border=\"0\" style=\"'+ style+ 'width: '+ width +'px; height: '+ height +'px; ' + 
		'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\'' + imgfile + '\',sizingMethod=\'scale\')\" />';
		document.write(content);
	}
	else  {
		var content = '<img border=\"0\"  style=\"'+style+'\" src=\"' + imgfile + '\" width=\"'+ width +'\" height=\"'+ height +'\"></div>';
		document.write(content);
	}
}

function fillAddress() {
	document.f1.company2.value = document.f1.company.value;
	document.f1.fname2.value = document.f1.fname.value;
	document.f1.lname2.value = document.f1.lname.value;
	document.f1.address2.value = document.f1.address.value;
	document.f1.city2.value = document.f1.city.value;
	document.f1.prov2.value = document.f1.prov.value;
	document.f1.postal2.value = document.f1.postal.value;
	document.f1.country2.value = document.f1.country.value;	
	document.f1.phone2.value = document.f1.phone.value;
}

function buildMenuList(menu, opts)
{
	for(i=0;i<opts.length;i++)
	{
		menu[i] = new Option(opts[i].title, opts[i].code); 
	}
}

function build_campaign_code(code, level){
	_ajax = new Ajax.Request(
		'emcms/includes/lib_ajax_menu.php',
		{
			method : 'post',
			parameters : 'code=' + code +'& level=' + level,
			onComplete : function(req, json)
			{
				$(level).options.length = 0;
				buildMenuList($(level), json);
				
			}
		}
	);
}

