var v_first_run = true;
var v_listener_url;
var v_url = "";
var i = 0;
var j = 0;
var v_len = 0;
var v_criteria = "";
var v_string = "";
var v_found = 0;
var v_content = "";
var v_last_content = "";
var v_contents = new Array("", "inicio", "quienes-somos", "servicios", "productos-web", "portafolio", "casos-de-exito", "contactenos");
var v_title = document.title;
function f_check_url(){
	if (v_url != document.location.href){
		v_url = document.location.href;
		v_found = 0;
		v_content = "";
		i = v_url.indexOf("#");
		if (i == -1){
			for (j = 1; j < v_contents.length; j ++){
				if (v_url.lastIndexOf(v_contents[j]) != -1){
					v_found = j;
					break;
				}
			}
		} else {
			for (j = 1; j < v_contents.length; j ++){
				if (v_url.substr(i - 1).lastIndexOf(v_contents[j]) != -1){
					v_found = j;
					break;
				}
			}
		}
		if (v_found == 0){
			v_found = 1;	//inicio
		}
		v_content = v_contents[v_found];
		if (v_content != v_last_content){
			if (v_first_run){
				v_first_run = false;
				v_string = document.location.href;
				if (v_string.indexOf("#") == -1){
					document.location.replace(v_string + "#" + v_content);
				}
			}
			document["swfmain"].f_tell_swf_url(v_content);
		}
		if (document.title != v_title){
			document.title = v_title;
		}		
	}
}
function f_set_url(v_arg){
	v_last_content = v_arg;
	document.location.href = "#" + v_arg;
}
function f_swf_ready(){
	v_listener_url = setInterval("f_check_url()", 50);
}

