window.scroll_timer = new Array();
window.current_page = "index_main";
window.obj;
window.obj2;
window.cur_wn = 0;
window.new_hash;
window.trans = false;

window.trig_var = 1;
window.faq_height = 0;
window.faq_pos = 0;
window.gal_height = 0;
window.gal_pos = 0;
window.gal2_width = 0;
window.gal2_pos = 0;

$(document).ready( function()
{
	setActiveStyleSheet("main");
	check_hash();

	if (document.getElementById('whats_new_0'))
	{
		window.setInterval("change_whatsnew()", 10000);
	}

});

function change_whatsnew()
{
	if (isIE)
	{
		$("#whats_new_"+window.cur_wn).css("display", "none");
	} else {$("#whats_new_"+window.cur_wn).fadeOut("slow");}
	window.cur_wn++;
	if (window.cur_wn == 4) { window.cur_wn = 0; }
	if (isIE)
	{$("#whats_new_"+window.cur_wn).slideDown("slow");} else {$("#whats_new_"+window.cur_wn).fadeIn("slow");}
}

function check_hash()
{
	if (window.trans == false)
	{

	var hash_data = parent.location.hash;
	var hash_attr = new Array();
	var attr_counter = 0;

	hash_data = hash_data.replace(/#/, "");
	hash_data = hash_data.split("/");

	if (window.current_page == hash_data[0] && hash_data[0] != "sap" && hash_data[1])
	{
		if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && hash_data[1]) {reload_solution(hash_data[1]);}
	}

	if (window.current_page != "index_main" && !hash_data[0])
	{
		if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && hash_data[1])
		{
			switch_solution(hash_data[1], document.getElementById('hidden_sol').innerHTML);
			open_page("index_main", "solution="+hash_data[1]);
		} else {
			open_page("index_main", "solution="+document.getElementById('hidden_sol').innerHTML);
		}
	}

	if (window.current_page != hash_data[0] && hash_data[0] == "products_main")
	{
		if (hash_data[2])
		{
			if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && (hash_data[1] == "ht" || hash_data[1] == "ds" || hash_data[1] == "mu") && hash_data[1])
			{
				switch_solution(hash_data[1], document.getElementById('hidden_sol').innerHTML);
				open_page(hash_data[0], "solution="+hash_data[1]+"&product="+hash_data[2]);
			} else {
				open_page(hash_data[0], "solution="+document.getElementById('hidden_sol').innerHTML+"&product="+hash_data[2]);
			}

		} else {

			if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && (hash_data[1] == "ht" || hash_data[1] == "ds" || hash_data[1] == "mu") && hash_data[1])
			{
				switch_solution(hash_data[1], document.getElementById('hidden_sol').innerHTML);
				open_page(hash_data[0], "solution="+hash_data[1]);
			} else {
				open_page(hash_data[0], "solution="+document.getElementById('hidden_sol').innerHTML);
			}
		}

	} else if (window.current_page != hash_data[0] && hash_data[0] == "partners_main") {
		if (hash_data[2])
		{
			if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && (hash_data[1] == "ht" || hash_data[1] == "ds" || hash_data[1] == "mu") && hash_data[1])
			{
				switch_solution(hash_data[1], document.getElementById('hidden_sol').innerHTML);
				open_page(hash_data[0], "solution="+hash_data[1]+"&section="+hash_data[2]);
			} else {
				open_page(hash_data[0], "solution="+document.getElementById('hidden_sol').innerHTML+"&section="+hash_data[2]);
			}

		} else {

			if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && (hash_data[1] == "ht" || hash_data[1] == "ds" || hash_data[1] == "mu") && hash_data[1])
			{
				switch_solution(hash_data[1], document.getElementById('hidden_sol').innerHTML);
				open_page(hash_data[0], "solution="+hash_data[1]);
			} else {
				open_page(hash_data[0], "solution="+document.getElementById('hidden_sol').innerHTML);
			}
		}

	} else if (window.current_page != hash_data[0] && hash_data[0] == "sap") {
		if (hash_data[1])
		{
			open_page(hash_data[0], "solution="+document.getElementById('hidden_sol').innerHTML+"&sap="+hash_data[1]);
		}

	} else if (window.current_page != hash_data[0] && hash_data[0]) {

		if (document.getElementById('hidden_sol').innerHTML != hash_data[1] && (hash_data[1] == "ht" || hash_data[1] == "ds" || hash_data[1] == "mu") && hash_data[1])
		{
			switch_solution(hash_data[1], document.getElementById('hidden_sol').innerHTML);
			open_page(hash_data[0], "solution="+hash_data[1]);
		} else {
			open_page(hash_data[0], "solution="+document.getElementById('hidden_sol').innerHTML);
		}
	}

	}

	window.setTimeout("check_hash()", 2000);
}

function reload_solution(new_solution)
{
	var cur_solution = document.getElementById("hidden_sol").innerHTML;
	var cur_page= document.getElementById("hidden_curpage").innerHTML;

	switch_solution(new_solution, cur_solution);

	switch_page(cur_page, '<?php echo $admin; ?>solution='+new_solution);
}

function switch_page_and_sol(new_page, new_solution, variables)
{
	var cur_solution = document.getElementById("hidden_sol").innerHTML;
	var cur_page = document.getElementById("hidden_curpage").innerHTML;

	switch_solution(new_solution, cur_solution);

	switch_page(new_page+"_main", 'solution='+new_solution+'&'+variables);
}

function isIE(versionNumber)
{
	var detect = navigator.userAgent.toLowerCase();
	if (!(navigator && navigator.userAgent && navigator.userAgent.toLowerCase))
	{
		return false;
	} else {
  	        if (detect.indexOf('msie') + 1)
		{
			// browser is internet explorer
			var ver = function()
			{
				// http://msdn.microsoft.com/workshop/author/dhtml/overview/browserdetection.asp
				// Returns the version of Internet Explorer or a -1
				// (indicating the use of another browser).
				var rv = -1; // Return value assumes failure
				if (navigator.appName == 'Microsoft Internet Explorer')
				{
					var ua = navigator.userAgent;
					var re = new RegExp("MSIE ([0-9]{1,}[\.0-9]{0,})");
					if (re.exec(ua) != null)
					{
						rv = parseFloat( RegExp.$1 );
					}
				}
				return rv;
			};
			var valid = true;
			// if the version can be found and the version is less than our version number it is invalid
			if ((ver > -1) && (ver < versionNumber))
			{
				valid = false;
			}
			return valid;
  	        } else {
			return false
  	        }
	}
}

var isChrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
var isFF = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;
var isIE = isIE();

function alter_content()
{

	var elem_div = document.getElementsByTagName("div");

	for (i=0; i < elem_div.length; i++) 
	{

		var elem_class = elem_div.item(i).className.split("-");

		switch (elem_class[0])
		{

			case "replace":
				elem_div.item(i).innerHTML = document.getElementById(elem_class[1]).innerHTML;
				break;

		}

	}

	for (i=0; i < elem_div.length; i++) 
	{

		switch (elem_div.item(i).className)
		{

			case "remove":
				elem_div.item(i).innerHTML = "";
				break;

			case "redirect":
				window.location = "http://www.mvixusa.com/index.php/mvix/index/#"+elem_div.item(i).innerHTML;
				break;

		}

	}

}

function animate_content()
{
	var elem_div = document.getElementsByTagName("div");

	for (i=0; i < elem_div.length; i++) 
	{

		var elem_class = elem_div.item(i).className.split("-");

		switch (elem_class[0])
		{

			case "scroll":
				var elem_id = elem_div.item(i).id;
				var sub_id = elem_id+"_sub";

				var duplicate_sub = document.createElement('div');
				duplicate_sub.setAttribute("id", sub_id+"_dup");
				document.getElementById(elem_id).appendChild(duplicate_sub);
				document.getElementById(sub_id+"_dup").className = document.getElementById(sub_id).className;
				document.getElementById(sub_id+"_dup").innerHTML = document.getElementById(sub_id).innerHTML;

				if (!document.getElementById(sub_id).style.position || document.getElementById(sub_id).style.position != "absolute")
				{

					document.getElementById(sub_id).style.position = "absolute";
					document.getElementById(sub_id).style.top = "0px";
					document.getElementById(sub_id+"_dup").style.position = "absolute";

				}
				document.getElementById(sub_id+"_dup").style.top = document.getElementById(sub_id).offsetHeight+"px";

				switch (elem_class[1])
				{
					case "fluid":
						var scroll_func = "scroll_element('"+sub_id+"')";
						scroll_timer[sub_id] = window.setInterval(scroll_func, 100);
						break;

					case "delayed":
						var scroll_func = "scroll_element('"+sub_id+"', 'true')";
						scroll_timer[sub_id] = window.setInterval(scroll_func, 100);
						break;
				}
				break;

		}

	}

}

function scroll_element(sub_id, delayed)
{

	var cur_pos1 = document.getElementById(sub_id).style.top.replace(/px/, "");
	var cur_pos2 = document.getElementById(sub_id+"_dup").style.top.replace(/px/, "");

	document.getElementById(sub_id).style.top = (cur_pos1-1)+"px";
	document.getElementById(sub_id+"_dup").style.top = (cur_pos2-1)+"px";

	if (document.getElementById(sub_id+"_dup").style.top == "0px")
	{

		if (delayed == 'true')
		{

			var scroll_wait = new Array();

			window.clearInterval(window.scroll_timer[sub_id]);
			var wait_func = "scroll_reset('"+sub_id+"', 'true')";
			scroll_wait[sub_id] = window.setTimeout(wait_func, 5000);

		} else {scroll_reset(sub_id);}

	}

}

function scroll_reset(sub_id, delayed)
{

	document.getElementById(sub_id).style.top = "0px";
	document.getElementById(sub_id+"_dup").style.top = document.getElementById(sub_id).offsetHeight+"px";

	if (delayed == 'true')
	{

		var scroll_func = "scroll_element('"+sub_id+"', 'true')";
		scroll_timer[sub_id] = window.setInterval(scroll_func, 100);

	}

}

function open_popup(new_page, variables)
{
	ajax_request('popupload', new_page+"&"+variables, 'http://www.mvixusa.com/index.php/scripts/global_getpage/');
	document.getElementById("dark_div").style.display = "block";

	document.getElementById("popupbox").style.display = "block";
	//document.getElementById("body_id").style.overflow = "hidden";
	//document.getElementById("body_id").style.height = "100%";
	document.getElementById("dark_div").style.position = "fixed";
	document.getElementById("popupbox").style.position = "fixed";
}

function close_popup()
{
	document.getElementById("popup_content").innerHTML = "";
	document.getElementById("body_id").style.overflow = "auto";
	document.getElementById("dark_div").style.display = "none";
	document.getElementById("popupbox").style.display = "none";
}

function switch_popup(new_content)
{
	$(".subsub_content").css("display", "none");
	document.getElementById("subsub_content_"+new_content).style.display = "block";
}

function switch_solution(new_solution, cur_solution)
{

	if (cur_solution != "")
	{
		var regsol = "solution="+cur_solution;
		var regsol_mode = cur_solution+"/";
		regsol = new RegExp(regsol);

		$(".nav_a").each(function()
		{
			this.href = this.href.replace(regsol, "solution="+new_solution);
		});

	} else {

		var regsol = "''";
		regsol = new RegExp(regsol);

		$(".nav_a").each(function()
		{
			this.href = this.href.replace(regsol, "'solution="+new_solution+"'");
		});

		regsol = "'product=";
		regsol = new RegExp(regsol);

		$(".nav_a").each(function()
		{
			this.href = this.href.replace(regsol, "'solution="+new_solution+"&product=");
		});
	}

	$("#mode_change").each(function()
	{
		if (cur_solution != "")
		{
			this.href = this.href.replace(regsol_mode, new_solution+"/");

		} else {

			this.href += new_solution+"/";
		}
	});

	if (cur_solution != "") { document.getElementById("nav_item_"+cur_solution).style.display = "none"; } else { document.getElementById("nav_item_land").style.display = "none"; }
	document.getElementById("nav_item_"+new_solution).style.display = "block";

	if (new_solution == "ds")
	{
		document.getElementById("nav_pitem_land").style.display = "none";
		document.getElementById("nav_pitem_ht").style.display = "none";
		document.getElementById("nav_pitem_mu").style.display = "none";
		document.getElementById("nav_pitem_ds").style.display = "block";

	} else if (new_solution == "ht") {

		document.getElementById("nav_pitem_land").style.display = "none";
		document.getElementById("nav_pitem_ht").style.display = "block";
		document.getElementById("nav_pitem_mu").style.display = "none";
		document.getElementById("nav_pitem_ds").style.display = "none";

	} else if (new_solution == "mu") {

		document.getElementById("nav_pitem_land").style.display = "none";
		document.getElementById("nav_pitem_ht").style.display = "none";
		document.getElementById("nav_pitem_mu").style.display = "block";
		document.getElementById("nav_pitem_ds").style.display = "none";

	} else {

		document.getElementById("nav_pitem_land").style.display = "block";
		document.getElementById("nav_pitem_ht").style.display = "none";
		document.getElementById("nav_pitem_mu").style.display = "none";
		document.getElementById("nav_pitem_ds").style.display = "none";
	}

	document.getElementById("hidden_sol").innerHTML = new_solution;
	if (window.current_page != "sap") { set_hash(false, new_solution); }
}

function open_page(new_page, variables)
{
	if (new_page == "index_main")
	{
		document.getElementById("nav_logo_js").style.display = "none";

	} else {

		document.getElementById("nav_logo_js").style.display = "block";
	}

	ajax_request('pageload', new_page+"&"+variables, 'http://www.mvixusa.com/index.php/scripts/global_getpage/');
	document.getElementById("hidden_curpage").innerHTML = new_page;

	switch (new_page)
	{
		case "products_main":
			if (variables.match(/product=/))
			{
				if (variables.match(/solution=/))
				{
					var attr = variables.replace(/solution=/, "");
					attr = attr.replace(/product=/, "");
					attr = attr.split("&");

					set_hash("products_main", attr[0], attr[1]);
				} else {
					var attr = variables.replace(/product=/, "");

					set_hash("products_main", document.getElementById('hidden_sol').innerHTML, attr);
				}
			} else {
				set_hash("products_main", document.getElementById('hidden_sol').innerHTML);
			}
			break;

		case "partners_main":
			if (variables.match(/section=/))
			{
				if (variables.match(/solution=/))
				{
					var attr = variables.replace(/solution=/, "");
					attr = attr.replace(/section=/, "");
					attr = attr.split("&");

					set_hash("partners_main", attr[0], attr[1]);
				} else {
					var attr = variables.replace(/section=/, "");

					set_hash("partners_main", document.getElementById('hidden_sol').innerHTML, attr);
				}
			} else {
				set_hash("partners_main", document.getElementById('hidden_sol').innerHTML);
			}
			break;

		case "sap":
			if (variables.match(/sap=/))
			{
				if (variables.match(/solution=/))
				{
					var attr = variables.replace(/solution=/, "");
					attr = attr.replace(/sap=/, "");
					attr = attr.split("&");

					set_hash("sap", attr[1]);
				} else {
					var attr = variables.replace(/sap=/, "");

					set_hash("sap", attr);
				}
			} else {set_hash("sap");}
			break;

		default:
			if (variables.match(/solution=/))
			{
				var new_sol = variables.replace(/solution=/, "");
				new_sol = new_sol.split("&");
				set_hash(new_page, new_sol[0]);
			} else {
				set_hash(new_page, document.getElementById('hidden_sol').innerHTML);
			}
			break;
	}
}

function ajax_request(request_type, requests, url)
{
	window.trans = true;

	var str;
	switch (request_type)
	{

		case "pageload":
			str = "page="+requests;
			break;

		case "popupload":
			str = "popup="+requests;
			break;

	}

	xmlHttp = GetXmlHttpObject();
		
	if (xmlHttp == null)
	{

		//document.getElementById("output").innerHTML = "cannot connect to server";
		return;

	}
		
	xmlHttp.open("POST", url, true);
	xmlHttp.onreadystatechange = stateChanged;
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	
	xmlHttp.send("req="+request_type+"&"+str);

	return;

}

function stateChanged() 
{

	if (xmlHttp.readyState == 4)
	{ 

		if (xmlHttp.status == 200)
		{

			var returnstr = xmlHttp.responseText;
			var brokenstr = returnstr.split("^split^");

			pageTracker._trackPageview(brokenstr[1]);

			window.trans = false;

			if (brokenstr[1] == "popup")
			{
				document.getElementById("popup_content").innerHTML = brokenstr[2];

				Recaptcha.create("6Lei0AIAAAAAAKeihFelhnqEUXATK9ZBGGhW5un-",
					"recaptcha_div", {
					theme: "white",
					callback: Recaptcha.focus_response_field
				});
				// switch for legal stuff

				$("#t_tab").click( function()
				{

					$("#trademarks").css("display", "block");
					$("#guidelines").css("display","none");
					$("#attributions").css("display","none");
				});

				$("#g_tab").click( function()
				{
					$("#trademarks").css("display", "none");
					$("#guidelines").css("display","block");
					$("#attributions").css("display","none");
				});
				$("#a_tab").click( function()
				{
					$("#trademarks").css("display", "none");
					$("#guidelines").css("display","none");
					$("#attributions").css("display","block");
				});

				// switch for ds for small business overview/benefits tab
				$("#o_tab").click( function()
				{
					$("#ds_pop_overview").css("display", "block");
					$("#ds_pop_benefits").css("display","none");
				});
				$("#b_tab").click( function()
				{
					$("#ds_pop_overview").css("display", "none");
					$("#ds_pop_benefits").css("display","block");
				});
				// switcher for about_us

				$("#about_us_map").click( function()
				{
					$("#about_us_popup").css("display", "none");
					$("#about_us_map_big").css("display","block");
				});
				$("#about_us_map_small").click( function()
				{
					$("#about_us_popup").css("display", "block");
					$("#about_us_map_big").css("display","none");
				});

				$(".tt_link").hover( function()
				{
					var new_cont = $(this).next(".tt_content").html();
					$("#tt_linkbox").css("display", "block");
					$("#tt_content").html(new_cont);
				}, function() {
					$("#tt_linkbox").css("display", "none");
				});
			
				$().mousemove( function(e)
				{
					var curX = (e.pageX+20);
					var curY = (e.pageY+20);
					if (curX > 700) { var ttx = (curX-290); } else { var ttx = curX; }
					if (curY > 550) { var tty = (curY-$("#tt_linkbox").css("height")); } else { var tty = curY; }
					$("#tt_linkbox").css({ left: ttx, top: tty});
				}); 

			} else {

			switch (brokenstr[1])
			{
				case "index_main":
					var style_var = "main";
					var container_var = brokenstr[1];
					break;

				case "products_main":
					var style_var = "products_styles";
					var container_var = brokenstr[1];
					break;

				case "products_buy":
					var style_var = "products_styles";
					var container_var = "products_main";
					break;

				case "products_compare":
					var style_var = "products_styles";
					var container_var = "products_main";
					break;

				case "partners_main":
					var style_var = "partners_styles";
					var container_var = brokenstr[1];
					break;

				case "support_main":
					var style_var = "support_styles";
					var container_var = brokenstr[1];
					break;

				case "buzz_main":
					var style_var = "buzz_styles";
					var container_var = brokenstr[1];
					break;

				case "buzz_news":
					var style_var = "buzz_styles";
					var container_var = "buzz_main";
					break;

				case "buzz_pressrel":
					var style_var = "buzz_styles";
					var container_var = "buzz_main";
					break;

				case "buzz_reviews":
					var style_var = "buzz_styles";
					var container_var = "buzz_main";
					break;

				case "buzz_newsletter2":
					var style_var = "buzz_styles";
					var container_var = "buzz_main";
					break;

				case "about_main":
					var style_var = "about_styles";
					var container_var = brokenstr[1];
					break;

				case "contact_main":
					var style_var = "contact_styles";
					var container_var = brokenstr[1];
					break;

			}

			function ani_bg2() 
			{
				var heightx = document.getElementById("global_bg").height;

				if (heightx >= 620)
				{
					document.getElementById("global_bg").height = "618";
					window.clearInterval(bg_ani_id2);
					$("#index_main").css("display", "block");
					if (isIE)
					{
						var bg_ani_id3;
						bg_ani_id3 = window.setTimeout('document.getElementById("page_content").style.display = "block";', 1000);
					} else {
						var bg_ani_id3;
						bg_ani_id3 = window.setTimeout('$("#page_content").fadeIn("slow");', 1000);
					}
				} else {
					document.getElementById("global_bg").height = heightx+20;
				}
			}

			document.getElementById("page_content").style.display = "none";
			document.getElementById("page_content").innerHTML = brokenstr[2];
			//document.getElementById(container_var).style.display = "none";

			setActiveStyleSheet(style_var);

			//if (style_var == "index_styles") { document.getElementById("page_styles").innerHTML = ""; } else
			//{
			//	if (document.createStyleSheet)
			//	{
			//		document.createStyleSheet('http://www.mvixusa.com/index.php?css=styles/'+style_var);
			//		document.getElementById(container_var).style.fontFamily = "Verdana";
//
			//	} else {
//
			//		document.getElementById("page_styles").innerHTML = "<link rel='stylesheet' type='text/css' media='all' href='http://www.mvixusa.com/index.php?css=styles/"+style_var+"' />";
			//	}
			//}

			if (window.execScript)
			{window.execScript(document.getElementById("js_httpcontent").innerHTML);} else {eval(document.getElementById("js_httpcontent").innerHTML);}

			//document.getElementById("page_content").style.display = "inline";

			if (container_var == "index_main")
			{
				document.getElementById("global_bg").style.display = "inline";
				var bg_ani_id2;
				bg_ani_id2 = window.setInterval(ani_bg2, 5);

				$("div.index_submnu_div").hover( function()
				{
					$(this).dequeue().animate({
						left: -10
					}, 100);

				}, function() {

					$(this).dequeue().animate({
						left: 0
					}, 100);
				});

			} else {

				document.getElementById("global_bg").style.display = "none";
				//document.getElementById(container_var).style.display = "inline";
				if (isIE)
				{
					var bg_ani_id3;
					bg_ani_id3 = window.setTimeout('document.getElementById("page_content").style.display = "block";', 1000);
				} else {
					var bg_ani_id3;
					bg_ani_id3 = window.setTimeout('$("#page_content").fadeIn("slow");', 1000);
				}
			}

			if (container_var == "products_main")
			{
				//document.getElementById("page_styles").innerHTML = '<script src="http://bubble.websnapr.com/U23LxtqvNfGS/swh/" type="text/javascript"></script>';
				$("#kb_articles").accordion({ header: "a.head", autoHeight: false, event: "mouseover" });
			}

			if (container_var == "buzz_main")
			{
				$.getScript("http://bubble.websnapr.com/U23LxtqvNfGS/swh/");
				//document.getElementById("page_styles").innerHTML = '<script src="http://bubble.websnapr.com/U23LxtqvNfGS/swh/" type="text/javascript"></script>';

				$(".webthumb").hover( function()
				{
					var thumb_url = $(this).attr("href");
					thumb_url = thumb_url.replace(/http\:\/\//g,'');
					var cur_date = $("#hidden_date").html();
					var new_hash = hex_md5(cur_date + thumb_url + "47de31014f772667f1e63abc5af4d004");
					var new_cont = '<img width="220" height="140" src="http://webthumb.bluga.net/easythumb.php?user=3953&url='+urlencode(thumb_url)+'&hash='+new_hash+'&size=medium2&cache=30" alt="loading image..." />';
					$("#tt_linkbox").css("display", "block");
					$("#tt_content").html(new_cont);

				}, function() {

					$("#tt_linkbox").css("display", "none");
				});

				$("#articles").accordion({ header: "a.head", autoHeight: false, event: "mouseover" });
			}

			if (container_var == "about_main")
			{

				$("#about_a_company").hover( function()
				{
					if (window.obj2)
					{
						window.obj2.find('div.about_subheader').fadeOut('fast');
						window.obj2.find('div.about_item_js').hide('fast');
						window.obj2 = null;
					}

					$(this).find('div.about_subheader').fadeIn('fast');
					$(this).find('div.about_item_js').show('fast');

				}, function() {

					window.obj2 = $(this);

					if (window.obj2)
					{
						window.obj2.find('div.about_subheader').fadeOut('fast');
						window.obj2.find('div.about_item_js').hide('fast');
					}
				});

			}


			$(".tt_link").hover( function()
			{
				var new_cont = $(this).next(".tt_content").html();
				$("#tt_linkbox").css("display", "block");
				$("#tt_content").html(new_cont);
			}, function() {
				$("#tt_linkbox").css("display", "none");
			});

			$().mousemove( function(e)
			{
				var curX = (e.pageX+20);
				var curY = (e.pageY+20);
				if (curX > 700) { var ttx = (curX-290); } else { var ttx = curX; }
				if (curY > 550) { var tty = (curY-$("#tt_linkbox").css("height")); } else { var tty = curY; }
				$("#tt_linkbox").css({ left: ttx, top: tty });
			}); 

	$("div.global_subdd").find('.nav_item_js').find('a').hover( function()
	{
		if (!isIE)
		{
			$(this).parent('.nav_item_js').find('a').not(this).find("img").fadeTo("fast", 0.6);
			$(this).find("img").dequeue().fadeTo("fast", 1);
		}
		$(this).find("p").dequeue().css("font-weight", "bold");

	}, function() {

		if (!isIE)
		{
			$(this).find("img").fadeTo("fast", 0.6);
		}
		$(this).find("p").css("font-weight", "normal");
	});

	$(".global_subdd").hover( function()
	{

		if (window.obj)
		{
			//window.obj.find('div.global_subfooter').fadeOut('fast');
			//$(this).find('div.global_subfooter').animate(
			//{
			//	top: "-10px"
			//}, 'fast').find('div.nav_item_js').hide('fast');
			//window.obj.find('div.nav_item_js').hide('fast');
			//if (isIE || isChrome)
			//{
				//window.obj.find('div.nav_item_js').slideUp('fast');
			//	window.obj.find('div.global_subfooter').animate(
			//	{
			//		top: "-10px"
			//	}, 'fast').find('div.nav_item_js').slideUp('fast');
			//	window.obj.find('div.global_subfooter').css("display", "none");
			//} else {
			//	window.obj.find('div.global_subfooter').fadeOut('fast');
			//	window.obj.find('div.global_subfooter').animate(
			//	{
			//		top: "-10px"
			//	}, 'fast').find('div.nav_item_js').hide('fast');
				//window.obj.find('div.nav_item_js').hide('fast');
			//}
			window.obj = null;
		}

		if (isIE || isChrome)
		{
			$(this).find('div.global_subfooter').css("display", "block");
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-263px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-436px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-238px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-436px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			//$(this).find('div.nav_item_js').slideDown('fast');
		} else if (isFF) {
			$(this).find('div.global_subfooter').css("display", "block");
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').css("top", "-263px").find('div.nav_item_js').css("display", "block");
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').css("top", "-436px").find('div.nav_item_js').css("display", "block");
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').css("top", "-238px").find('div.nav_item_js').css("display", "block");
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').css("top", "-436px").find('div.nav_item_js').css("display", "block");
			}
		} else {
			$(this).find('div.global_subfooter').fadeIn('fast');
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-263px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-436px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-238px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-436px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			//$(this).find('div.nav_item_js').show('fast');
		}

	}, function() {

		window.obj = $(this);

		if (window.obj)
		{

			if (isIE || isChrome)
			{
				window.obj.find('div.global_subfooter').animate(
				{
					top: "-10px"
				}, 'fast').find('div.nav_item_js').slideUp('fast');
				window.obj.find('div.global_subfooter').css("display", "none");
				//window.obj.find('div.nav_item_js').slideUp('fast');
			} else if (isFF) {
				window.obj.find('div.global_subfooter').css("display", "none");
				window.obj.find('div.global_subfooter').css("top", "-10px").find('div.nav_item_js').css("display", "none");
			} else {
				window.obj.find('div.global_subfooter').fadeOut('fast');
				window.obj.find('div.global_subfooter').animate(
				{
					top: "-10px"
				}, 'fast').find('div.nav_item_js').hide('fast');
				//window.obj.find('div.nav_item_js').hide('fast');
			}
		}
	});

			window.current_page = brokenstr[1];
			}

		}

	}

}
	
function GetXmlHttpObject()
{

	var xmlHttp=null;
	
	try
	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	
	} catch (e) {
		// Internet Explorer
		try
		{
	
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			
		} catch (e) {
			
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");

		}

	}
		
	return xmlHttp;

}

function urlencode(str)
{
	return escape(str).replace(/\+/g,'%2B').replace(/%20/g, '+').replace(/\*/g, '%2A').replace(/\//g, '%2F').replace(/@/g, '%40');
}

function set_hash(new_page, new_sol, new_attr1, new_attr2, new_attr3)
{
	var hash_data = parent.location.hash;
	var new_hash = "";

	hash_data = hash_data.replace(/#/, "");
	hash_data = hash_data.split("/");

	if (new_page)
	{
		hash_data[0] = new_page;
	}

	if (new_sol && new_sol != "")
	{
		hash_data[1] = new_sol;
	} else {
		hash_data[1] = "no_attr";
	}

	if (new_attr1)
	{
		hash_data[2] = new_attr1;
	} else {
		hash_data[2] = "no_attr";
	}

	if (new_attr2)
	{
		hash_data[3] = new_attr2;
	} else {
		hash_data[3] = "no_attr";
	}

	if (new_attr3)
	{
		hash_data[4] = new_attr3;
	} else {
		hash_data[4] = "no_attr";
	}

	for (var hk = 0; hk < hash_data.length; hk++)
	{
		if (hash_data[hk] != "no_attr")
		{
			if (hk > 0) { new_hash += "/"; }
			new_hash += hash_data[hk];
		}
	}

	parent.location.hash = new_hash;
}

// products page functions
function open_section(new_section) 
{
				for (var y = 0; y < 6; y++)
				{
					yy = y+1;
					document.getElementById("products_content_"+y).style.display = "none";
					document.getElementById("products_arrow"+yy).style.visibility = "hidden";
				}

				switch (new_section)
				{
					case "features":
						sect_var = 0;
						document.getElementById("products_arrow1").style.visibility = "visible";
						break;

					case "overview":
						sect_var = 1;
						document.getElementById("products_arrow2").style.visibility = "visible";
						break;

					case "gallery":
						sect_var = 2;
						//document.getElementById("products_arrow3").style.visibility = "visible";
						break;

					case "specs":
						sect_var = 3;
						document.getElementById("products_arrow3").style.visibility = "visible";
						break;

					case "reviews":
						sect_var = 4;
						document.getElementById("products_arrow4").style.visibility = "visible";
						break;

					case "buy":
						sect_var = 5;
						document.getElementById("products_arrow5").style.visibility = "visible";
						break;
				}

				document.getElementById("products_content_"+sect_var).style.display = "block";
}

function open_gallery(cur_url)
{
	//if (!isIE)
	//{
	//	if ($("#gallery_img").css("display") == "none" && window.trig_var == 1)
	//	{
	//		window.trig_var = 0;
	//		$("#gallery_img").attr("src", "http://www.mvixusa.com/img/products/"+cur_url).fadeIn("slow", function() { window.trig_var += 0.5; });
	//		$("#gallery_img2").fadeOut("slow", function() { window.trig_var += 0.5; });
	//	}

	//	if ($("#gallery_img2").css("display") == "none" && window.trig_var == 1)
	//	{
	//		window.trig_var = 0;
	//		$("#gallery_img").fadeOut("slow", function() { window.trig_var += 0.5; });
	//		$("#gallery_img2").attr("src", "http://www.mvixusa.com/img/products/"+cur_url).fadeIn("slow", function() { window.trig_var += 0.5; });
	//	}

	//} else {

	//	$("#gallery_img2").css("display", "none");
	//	$("#gallery_span").css("display", "block");
	//	$("#gallery_img").css("display", "block");
	//	$("#gallery_img").attr("src", "http://www.mvixusa.com/img/products/"+cur_url);		
	//}

	document.getElementById("dark_div").style.position = "fixed";
	document.getElementById("dark_div").style.display = "inline";
	document.getElementById("imgbox").style.position = "fixed";
	document.getElementById("imgbox").style.display = "block";
}

function close_gallery()
{
	document.getElementById("dark_div").style.display = "none";
	document.getElementById("imgbox").style.display = "none";
}

function scroll_up()
{
	if (window.faq_height == 0)
	{
		window.faq_height = $("#kb_articles").height();
	}

	if (window.faq_pos < 0)
	{
		window.faq_pos = window.faq_pos+175;

		//$("#kb_articles").css("top", window.faq_pos+"px");
		$("#kb_articles").animate(
		{
			top: window.faq_pos+"px"
		}, "fast");
	}
}

function scroll_down()
{
	if (window.faq_height == 0)
	{
		window.faq_height = $("#kb_articles").height();
	}

	if ((window.faq_pos-350) > -window.faq_height)
	{
		window.faq_pos = window.faq_pos-175;

		//$("#kb_articles").css("top", window.faq_pos+"px");
		$("#kb_articles").animate(
		{
			top: window.faq_pos+"px"
		}, "fast");
	}
}

function gallery_up()
{
	if (window.gal_height == 0)
	{
		window.gal_height = $("#gal_div").height();
	}

	if (window.gal_pos < 0)
	{
		window.gal_pos = window.gal_pos+174;

		//$("#gal_div").css("top", window.gal_pos+"px");
		$("#gal_div").animate(
		{
			top: window.gal_pos+"px"
		}, "fast");
	}
}

function gallery_down()
{
	if (window.gal_height == 0)
	{
		window.gal_height = $("#gal_div").height();
	}

	if ((window.gal_pos-350) > -window.gal_height)
	{
		window.gal_pos = window.gal_pos-174;

		//$("#gal_div").css("top", window.gal_pos+"px");
		$("#gal_div").animate(
		{
			top: window.gal_pos+"px"
		}, "fast");
	}
}

function gallery_up2()
{
	if (window.gal2_width == 0)
	{
		window.gal2_width = $("#gal_div2").width();
	}

	if (window.gal2_pos < 0)
	{
		window.gal2_pos = window.gal2_pos+45;

		//$("#gal_div2").css("left", window.gal2_pos+"px");
		$("#gal_div2").animate(
		{
			left: window.gal2_pos+"px"
		}, "fast");
	}
}

function gallery_down2()
{
	if (window.gal2_width == 0)
	{
		window.gal2_width = $("#gal_div2").width();
	}

	if ((window.gal2_pos-270) > -window.gal2_width)
	{
		window.gal2_pos = window.gal2_pos-45;

		//$("#gal_div2").css("left", window.gal2_pos+"px");
		$("#gal_div2").animate(
		{
			left: window.gal2_pos+"px"
		}, "fast");
	}
}

function open_feature(feat_id)
{
	$(".feat_content").css("display", "none");

	document.getElementById("fc"+feat_id).style.display = "block";
}

function open_spec(spec_id)
{
	$(".spec_content").css("display", "none");

	document.getElementById("sc"+spec_id).style.display = "block";
}

function specpage(page_num)
{
	document.getElementById("spec_1").style.display = "none";
	document.getElementById("spec_2").style.display = "none";

	document.getElementById("spec_"+page_num).style.display = "block";
}

function highlight_type()
{
	var para1 = document.getElementById("online_select").options[document.getElementById("online_select").selectedIndex].value;
	var para2 = document.getElementById("country_select").options[document.getElementById("country_select").selectedIndex].value;
	var para3 = document.getElementById("product_select").options[document.getElementById("product_select").selectedIndex].value;

	if (para1 != "none")
	{
		$(".reseller_div").each( function()
		{
			if ($(this).find("#"+para1+"_us_ca").attr("value") == 1 || $(this).find("#"+para1+"_world").attr("value") == 1)
			{
				$(this).css("background-image", "url(img/resellers_logohl_150x100.jpg)");
			} else {
				$(this).css("background-image", "url(img/resellers_logobg_150x100.jpg)");
			}
		});
	}

	if (para2 != "none")
	{
		$(".reseller_div").each( function()
		{
			if ($(this).css("background-image") == "url(http://www.mvixusa.com/img/resellers_logohl_150x100.jpg)" || para1 == "none")
			{
				if ($(this).find("#online_"+para2).attr("value") == 1 || $(this).find("#offline_"+para2).attr("value") == 1)
				{
					$(this).css("background-image", "url(img/resellers_logohl_150x100.jpg)");
				} else {
					$(this).css("background-image", "url(img/resellers_logobg_150x100.jpg)");
				}
			}
		});
	}

	if (para3 != "none")
	{
		$(".reseller_div").each( function()
		{
			if ($(this).css("background-image") == "url(http://www.mvixusa.com/img/resellers_logohl_150x100.jpg)" || (para1 == "none" && para2 == "none"))
			{
				if ($(this).find("#"+para3+"_ht").attr("value") == 1 || $(this).find("#"+para3+"_ds").attr("value") == 1 || $(this).find("#"+para3+"_mu").attr("value") == 1)
				{
					$(this).css("background-image", "url(img/resellers_logohl_150x100.jpg)");
				} else {
					$(this).css("background-image", "url(img/resellers_logobg_150x100.jpg)");
				}
			}
		});
	}

	if (para1 == "none" && para2 == "none" && para3 == "none")
	{
		$(".reseller_div").each( function()
		{
			$(this).css("background-color", "#f8f8f8");
		});
	}
}

// JS Partners Page functions
function open_section_p(new_section) 
{
	for (var y = 1; y < 7; y++)
	{
		if (document.getElementById("partners_subcont"+y)) { document.getElementById("partners_subcont"+y).style.display = "none"; }
		document.getElementById("partners_arrow"+y).style.visibility = "hidden";
	}

	document.getElementById("partners_subcont"+new_section).style.display = "block";
	document.getElementById("partners_arrow"+(new_section-1)).style.visibility = "visible";

	set_hash("partners_main", document.getElementById('hidden_sol').innerHTML, new_section);
}

// Form functions

function submit_app(app_type)
{
	if (app_type == "partners")
	{
		var post_data = "";

		post_data += "submit=true";
		post_data += "&company_name="+document.getElementById("resapp_company_name").value;
		post_data += "&address="+document.getElementById("resapp_company_address").value;
		post_data += "&address2="+document.getElementById("resapp_company_address2").value;
		post_data += "&city="+document.getElementById("resapp_company_city").value;
		post_data += "&state="+document.getElementById("ressap_company_state").options[document.getElementById("ressap_company_state").selectedIndex].value;
		post_data += "&zip="+document.getElementById("resapp_company_zip").value;
		post_data += "&country="+document.getElementById("resapp_company_country").value;
		post_data += "&tax="+document.getElementById("resapp_company_taxid").value;
		post_data += "&contact_name="+document.getElementById("resapp_contact_name").value;
		post_data += "&position="+document.getElementById("resapp_contact_position").value;
		post_data += "&contact_email="+document.getElementById("resapp_contact_email").value;
		post_data += "&contact_phone_1="+document.getElementById("resapp_contact_phone1").value;
		post_data += "&contact_phone_2="+document.getElementById("resapp_contact_phone2").value;
		post_data += "&contact_phone_3="+document.getElementById("resapp_contact_phone3").value;
		post_data += "&contact_fax_1="+document.getElementById("resapp_contact_fax1").value;
		post_data += "&contact_fax_2="+document.getElementById("resapp_contact_fax2").value;
		post_data += "&contact_fax_3="+document.getElementById("resapp_contact_fax3").value;
		post_data += "&website="+document.getElementById("resapp_contact_url").value;
		post_data += "&years="+document.getElementById("company_background_yrs").value;
		post_data += "&employees="+document.getElementById("company_background_employees").value;
		post_data += "&selling_website="+document.getElementById("company_sell_web").checked;
		post_data += "&selling_retail="+document.getElementById("company_sell_retail").checked;
		post_data += "&selling_distributor="+document.getElementById("company_sell_distributor").checked;
		post_data += "&selling_ebay="+document.getElementById("company_sell_ebay").checked;
		post_data += "&marketing_advertising="+document.getElementById("company_marketing_advertising").checked;
		post_data += "&marketing_newsletter="+document.getElementById("company_marketing_newsletter").checked;
		post_data += "&marketing_sales="+document.getElementById("company_marketing_promos").checked;
		post_data += "&marketing_affiliate="+document.getElementById("company_marketing_affiliate").checked;
		post_data += "&description="+document.getElementById("company_description").innerHTML;
		post_data += "&revenue="+document.getElementById("company_revenue").value;
		post_data += "&ref_name_1="+document.getElementById("company_ref1_name").value;
		post_data += "&ref_name_2="+document.getElementById("company_ref2_name").value;
		post_data += "&ref_company_1="+document.getElementById("company_ref1_company").value;
		post_data += "&ref_company_2="+document.getElementById("company_ref2_company").value;
		post_data += "&ref_phone_1="+document.getElementById("company_ref1_phone").value;
		post_data += "&ref_phone_2="+document.getElementById("company_ref2_phone").value;
		post_data += "&ref_email_1="+document.getElementById("company_ref1_email").value;
		post_data += "&ref_email_2="+document.getElementById("company_ref2_email").value;
		post_data += "&hear="+document.getElementById("company_hearaboutus").value;
		post_data += "&name="+document.getElementById("company_agree").value;

		$.ajax(
		{
			type: "POST",
			url: "http://www.mvixusa.com/index.php/scripts/partners_validation/",
			data: post_data,
			success: function(msg)
			{
				if (msg == "success")
				{
					document.getElementById("sub_feedback").innerHTML = "<b style='color: green'>Application submitted successfully!&nbsp;&nbsp;</b>";
				} else {
					document.getElementById("sub_feedback").innerHTML = "<b style='color: red'>Please complete the following fields:</b><br />"+msg+"&nbsp;&nbsp;";
				}
			},
			error: function(msg)
			{
				document.getElementById("sub_feedback").innerHTML = "<b style='color: red'>Please complete the following fields: "+msg+"&nbsp;&nbsp;</b>";
			}
		});
	}

	if (app_type == "contact")
	{
		var post_data = "";

		post_data += "submit=true";
		post_data += "&conttype="+document.getElementById("conttype").value;
		post_data += "&cName="+document.getElementById("cName").value;
		post_data += "&cPhone="+document.getElementById("cPhone").value;
		post_data += "&cEmail="+document.getElementById("cEmail").value;
		post_data += "&message="+document.getElementById("message").value;
		if (document.getElementById("dept")) { post_data += "&dept="+document.getElementById("dept").options[document.getElementById("dept").selectedIndex].value; }
		post_data += "&recaptcha_challenge_field="+document.getElementById("recaptcha_challenge_field").value;
		post_data += "&recaptcha_response_field="+document.getElementById("recaptcha_response_field").value;

		$.ajax(
		{
			type: "POST",
			url: "http://www.mvixusa.com/index.php/scripts/contact_validation/",
			data: post_data,
			success: function(msg)
			{
				if (msg == "success")
				{
					document.getElementById("sub_feedback").innerHTML = "<b style='color: green'>Your message has been delivered</b><br />You will recieve a response to your inquiry within the next 24 hours";
				} else {
					document.getElementById("sub_feedback").innerHTML = "<b style='color: red'>Please complete the following fields:</b><br />"+msg+"&nbsp;&nbsp;";
				}
			},
			error: function(msg)
			{
				document.getElementById("sub_feedback").innerHTML = "<b style='color: red'>Please complete the following fields: "+msg+"&nbsp;&nbsp;</b>";
			}
		});
	}
}

// Jobs function

function switch_jobs(job_id)
{
	jobdivs = document.getElementsByName("jobdiv");

	for (var oj = 0; oj < jobdivs.length; oj++)
	{
		jobdivs[oj].style.display = "none";
	}

	document.getElementById("jobdiv_"+job_id).style.display = "block";
}

//  JS Header Menu functions
$(document).ready( function()
{

	var hash_data = parent.location.hash;

	hash_data = hash_data.replace(/#/, "");
	hash_data = hash_data.split("/");

	if (parent.location.hash == "" || hash_data[0] == "index_main") { $("#index_main, #global_bg").css("display", "block");  }

	alter_content();
	window.obj = null;
	window.obj2 = null;

	$("#global_header_mnu > div").hover( function()
	{
		if (window.obj)
		{
			window.obj.find('div.global_subheader').fadeOut('fast');
			window.obj.find('div.nav_item_js').hide('fast');
			window.obj = null;
		}

		if (isIE || isChrome)
		{
			$(this).find('div.global_subheader').css("display", "block");
			$(this).find('div.nav_item_js').slideDown('fast');
		} else if (isFF) {
			$(this).find('div.global_subheader').css("display", "block");
			$(this).find('div.nav_item_js').css("display", "block");
		} else {
			$(this).find('div.global_subheader').fadeIn('fast');
			$(this).find('div.nav_item_js').show('fast');
		}

	}, function() {

		window.obj = $(this);

		if (window.obj)
		{

			if (isIE || isChrome)
			{
				window.obj.find('div.global_subheader').css("display", "none");
				window.obj.find('div.nav_item_js').slideUp('fast');
			} else if (isFF) {
				window.obj.find('div.global_subheader').css("display", "none");
				window.obj.find('div.nav_item_js').css("display", "none");
			} else {
				window.obj.find('div.global_subheader').fadeOut('fast');
				window.obj.find('div.nav_item_js').hide('fast');
			}
		}
	});

	$("div.global_subdd").find('.nav_item_js').find('a').hover( function()
	{
		if (!isIE)
		{
			$(this).parent('.nav_item_js').find('a').not(this).find("img").fadeTo("fast", 0.6);
			$(this).find("img").dequeue().fadeTo("fast", 1);
		}
		$(this).find("p").dequeue().css("font-weight", "bold");

	}, function() {

		if (!isIE)
		{
			$(this).find("img").fadeTo("fast", 0.6);
		}
		$(this).find("p").css("font-weight", "normal");
	});

	$(".global_subdd").hover( function()
	{

		if (window.obj)
		{
			//window.obj.find('div.global_subfooter').fadeOut('fast');
			//$(this).find('div.global_subfooter').animate(
			//{
			//	top: "-10px"
			//}, 'fast').find('div.nav_item_js').hide('fast');
			//window.obj.find('div.nav_item_js').hide('fast');
			//if (isIE || isChrome)
			//{
				//window.obj.find('div.nav_item_js').slideUp('fast');
			//	window.obj.find('div.global_subfooter').animate(
			//	{
			//		top: "-10px"
			//	}, 'fast').find('div.nav_item_js').slideUp('fast');
			//	window.obj.find('div.global_subfooter').css("display", "none");
			//} else {
			//	window.obj.find('div.global_subfooter').fadeOut('fast');
			//	window.obj.find('div.global_subfooter').animate(
			//	{
			//		top: "-10px"
			//	}, 'fast').find('div.nav_item_js').hide('fast');
				//window.obj.find('div.nav_item_js').hide('fast');
			//}
			window.obj = null;
		}

		if (isChrome)
		{
			$(this).find('div.global_subfooter').css("display", "block");
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-258px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-431px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-233px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-431px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			//$(this).find('div.nav_item_js').slideDown('fast');
		} else if (isIE) {
			$(this).find('div.global_subfooter').css("display", "block");
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-273px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-420px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-226px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-421px"
				}, 'fast').find('div.nav_item_js').slideDown('fast')
			}
			//$(this).find('div.nav_item_js').slideDown('fast');
		} else if (isFF) {
			$(this).find('div.global_subfooter').css("display", "block");
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').css("top", "-263px").find('div.nav_item_js').css("display", "block");
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').css("top", "-436px").find('div.nav_item_js').css("display", "block");
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').css("top", "-238px").find('div.nav_item_js').css("display", "block");
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').css("top", "-436px").find('div.nav_item_js').css("display", "block");
			}
		} else {
			$(this).find('div.global_subfooter').fadeIn('fast');
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter1")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-263px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter2")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-436px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter3")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-238px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			if ($(this).find('div.global_subfooter').attr('id') == "global_subfooter4")
			{
				$(this).find('div.global_subfooter').animate(
				{
					top: "-436px"
				}, 'fast').find('div.nav_item_js').show('fast')
			}
			//$(this).find('div.nav_item_js').show('fast');
		}

	}, function() {

		window.obj = $(this);

		if (window.obj)
		{

			if (isIE || isChrome)
			{
				window.obj.find('div.global_subfooter').animate(
				{
					top: "-10px"
				}, 'fast').find('div.nav_item_js').slideUp('fast');
				window.obj.find('div.global_subfooter').css("display", "none");
				//window.obj.find('div.nav_item_js').slideUp('fast');
			} else if (isFF) {
				window.obj.find('div.global_subfooter').css("display", "none");
				window.obj.find('div.global_subfooter').css("top", "-10px").find('div.nav_item_js').css("display", "none");
			} else {
				window.obj.find('div.global_subfooter').fadeOut('fast');
				window.obj.find('div.global_subfooter').animate(
				{
					top: "-10px"
				}, 'fast').find('div.nav_item_js').hide('fast');
				//window.obj.find('div.nav_item_js').hide('fast');
			}
		}
	});

	$("div.nav_item_js > a, #nav_item_land > a, #nav_item_ht > a, #nav_item_ds > a, #nav_item_mu > a, #nav_pitem_land > a, #nav_pitem_ht > a, #nav_pitem_mu > a, #nav_pitem_ds > a").hover( function()
	{
		var el_height = this.offsetTop;

		$("div.head_mid").find("div.backdrop").dequeue().animate({
			top: el_height
		}, 100);

	}, function() {


	});

	$("div.nav_item_js").hover( function()
	{
		$("div.head_mid").find("div.backdrop").css("display", "block");

	}, function() {

		$("div.head_mid").find("div.backdrop").css("display", "none");
	});

	$("div.index_submnu_div").hover( function()
	{
		$(this).dequeue().animate({
			left: -10
		}, 100);

	}, function() {

		$(this).dequeue().animate({
			left: 0
		}, 100);
	});

				$(".tt_link").hover( function()
				{
					var new_cont = $(this).next(".tt_content").html();
					$("#tt_linkbox").css("display", "block");
					$("#tt_content").html(new_cont);
				}, function() {
					$("#tt_linkbox").css("display", "none");
				});

				$().mousemove( function(e)
				{
					var curX = (e.pageX+20);
					var curY = (e.pageY+20);
					if (curX > 700) { var ttx = (curX-290); } else { var ttx = curX; }
					if (curY > 550) { var tty = (curY-$("#tt_linkbox").css("height")); } else { var tty = curY; }
					$("#tt_linkbox").css({ left: ttx, top: tty });
				}); 

});