/*========================================================================*/
var OPERA	= (/Opera/i.test(window.navigator.userAgent));

var IE		= (/MSIE/i.test(window.navigator.userAgent) && !OPERA);

/**
*	Alias de document.getElementById()
*	@param	string		id del objeto
*	@param	boolean		evitar que IE devuelva elementos donde name == id
*	@return	object|null
*/
function get(oID, overideName)
{
	if (IE && overideName)
	{
		var elem = document.getElementsByTagName('*');
		for (var i=0;i<elem.length;i++)
			if (elem[i].getAttribute('id') && elem[i].getAttribute('id') == oID)
				return elem[i];
		return null;
	}
	return document.getElementById(oID);
}
/*========================================================================*/


//	-----------------------------------------------------------------

function insertValidSwf(movie_name, width, height, flashVars, target) {
/*
	document.write('<object type="application/x-shockwave-flash"');
	document.write('data="'+movie_name+'"');
	document.write('width="'+width+'" height="'+height+'">');
	document.write('<param name="movie"');
	document.write('value="'+movie_name+'" />');
	if (flashVars!='') {
		document.write('<param name="FlashVars" value="'+flashVars+'" />');
	}
	document.write('<param NAME="wmode" VALUE="transparent">');
	document.write('</object>');
*/
	code = '<object type="application/x-shockwave-flash"';
	code+= 'data="'+movie_name+'"';
	code+= 'width="'+width+'" height="'+height+'">';
	code+= '<param name="movie"';
	code+= 'value="'+movie_name+'" />';
	if (flashVars!='') {
		code+='<param name="FlashVars" value="'+flashVars+'" />';
	}
	code+= '<param NAME="wmode" VALUE="transparent" />';
	code+= '</object>';
//	get(target).innerHTML = code;
	$("#" + target).html(code);
}

//	-----------------------------------------------------------------

function ajax_nav(categoria_id, offset) {
	params = 'task=nav_productos&categoria_id='+categoria_id+'&offset='+offset;
	get('debug_txt').innerHTML = params;
	ajax.setReadyStateListener(function() {
		ajax.showStatus('Obteniendo datos...<br /><br />', 'ajax-status', true);
		if (ajax.ready()) {			
			result = ajax.getText();
			
		//	result_Arr = result.split('&');
			get('list_'+categoria_id).innerHTML = result;
			
			//alert(result);
		}
	});
	ajax.request('POST', params, 'ajax.php');
}


