var browserName=navigator.appName;

function GetBrowser() {
if (browserName=="Microsoft Internet Explorer")
	{
	//load ie friendly stylesheet
	document.write('<link rel="stylesheet" href="default.css" type="text/css">')
	document.write('<link rel="stylesheet" href="homepage.css" type="text/css">')
	}
else
	{
	if ((parseFloat(navigator.appVersion)) >= 5 )
		{
		// if ns version is great than or equal to 5 (6) load this stylesheet
		document.write('<link rel="stylesheet" href="defaultmoz.css" type="text/css">')
		document.write('<link rel="stylesheet" href="homepagemoz.css" type="text/css">')
		}
	else
		{
		//if you have a really ancient browser  (ie. NS 4.7 or earlier) load this stylesheet
		document.write('<link rel="stylesheet" href="defaultmoz.css" type="text/css">')
		document.write('<link rel="stylesheet" href="homepagemoz.css" type="text/css">')
		}
}
}
var menuTimeout = 400

var menuSections = new Array()
var menuCountHide = new Array()

var menuSectionCnt = 0
var menuBoxCnt = 0

function menuShow(section, elements) {
  for (var i = 0; i < menuSections.length; i++) {
	if (menuSections[i] != section) {
	  menuHide(menuSections[i], menuCountNodes(menuSections[i]))
	}
  }
  for (var i = 1; i <= elements; i++) {
	document.getElementById(section + '-' + i).style.visibility = 'visible'
  }
}

function menuHide(section, elements) {
  for (var i = 1; i <= elements; i++) {
	document.getElementById(section + '-' + i).style.visibility = 'hidden'
  }
  document.getElementById(section).style.zIndex = -1
}

function menuTryHide(section, elements, countHide) {
  if (countHide != menuCountHide[section]) {
	return
  }
  menuHide(section, elements)
}

function menuCountNodes(element) {
  ret = 0
  nodes = document.getElementById(element).childNodes.length
  for (var i = 0; i < nodes; i++) {
	if (document.getElementById(element).childNodes[i].nodeType == 1) {
	  ret++
	}
  }
  return ret
}

function menuInitSection(section) {
  var elements = menuCountNodes(section)
  for (var i = 0; i <= elements; i++) {
	var s = (i == 0 ? (section + '-top') : (section + '-' + i))
	if (i == 0) {
	  document.getElementById(s).onmouseover = function() {
		menuShow(section, elements)
		menuCountHide[section]++
		for (var ii = 0; ii < menuSections.length; ii++) {
		  document.getElementById(section).style.zIndex = 99
		  if (menuSections[ii] != section) {
			document.getElementById(menuSections[ii]).style.zIndex = -1
		  }
		}
	  }
	} else {
	  document.getElementById(s).onmouseover = function() {
		//menuShow(section, elements)
		menuCountHide[section]++
	  }
	}
	document.getElementById(s).onmouseout = function() {
	  setTimeout("menuTryHide('" + section + "', " + elements + ", " + menuCountHide[section] + ")", menuTimeout)
	}
  }
}

function menuMakeId(nodes) {
  for (var i = 0; i < nodes.length; i++) {
	switch (nodes[i].className) {
	  case 'top':
		menuSectionCnt++
		menuBoxCnt = 0
		nodes[i].id = 'menu-' + menuSectionCnt + '-top'
		break
	  case 'section':
		nodes[i].id = 'menu-' + menuSectionCnt
		menuSections[menuSections.length] = nodes[i].id
		break
	  case 'box':
		menuBoxCnt++
		nodes[i].id = 'menu-' + menuSectionCnt + '-' + menuBoxCnt
		break
	}
	if (nodes[i].childNodes) {
	  menuMakeId(nodes[i].childNodes)
	}
  }
}

function menuInit() {
  menuMakeId(document.getElementById('menu').childNodes)
  for (var i = 0; i < menuSections.length; i++) {
	menuCountHide[menuSections[i]] = 0
  }
  for (var i = 0; i < menuSections.length; i++) {
	menuInitSection(menuSections[i])
  }
}

function gotourl(url) {
	document.location = url;
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function openWindow(url)
{
	popupWin=window.open(url,'remote','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=700,height=850,top=1,left=1')
}

function openPortal(url)
{
	popupWin=window.open(url,'portal','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=800,height=525,top=1,left=1')
}
function openCM(url)
{
	popupWin=window.open(url,'contact','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=600,height=645,top=1,left=1')
}

function openWindowTW(url)
{
	popupWin=window.open(url,'remote','toolbar=no, directories=no, location=no, status=yes, menubar=no, resizable=yes, scrollbars=yes, width=700,height=850,top=1,left=1')
}

function windowOpenTW(url,wd,ht)
		{
			features = "scrollbars=no,resizable=yes,top=50,left=100,width="+wd+",height="+ht
			window.open(url,'',features)
		}

function WriteHeader() {
	document.write('<noscript>Please enable Javascript on your browser!</noscript>');

	document.write('<div align=\"center\">');
		document.write('<a href=\"http://www.erealtyweb.net\" target=\"_top\"><img src=\"images/home_header.jpg\" border=0 alt=\"eRealtyweb Virtual Tours\"></a>');
	document.write('</div>');

	document.write('<div align=\"center\" style=\"padding-top:1px;\">');
		document.write('<TABLE ALIGN=\"center\" BORDER=0 CELLSPACING=0 CELLPADDING=0 WIDTH=\"800\">');
			document.write('<TR>');
				document.write('<td align=\"center\" valign=\"top\" width=\"800px\">');
				document.write('<table width=\"800px\" align=\"center\" cellspacing=\"0\" cellpadding=\"0\" id=\"navigation\">');
					document.write('<tr>');
						document.write('<td bgcolor=\"#98B8D8\"><img src=\"images/space.gif\" height=\"1\" width=\"800\" alt=\"\" hspace=\"0\" vspace=\"0\" border=\"0\"></td>');
					document.write('</tr>');
					document.write('<tr>');
						document.write('<td>');
							document.write('<div id=\"menu\">');
								document.write('<table width=\"775px\" ALIGN=\"center\" cellpadding=\"0\" cellspacing=\"0\" border=\"0\">');
									document.write('<tr>');
										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"http://www.erealtyweb.net\" target=\"_top\">Home</a>');
											document.write('</div>');
										document.write('</td>');
										document.write('<td width=\"7\">|</td>');
										
										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"vts_overview.html\" target=\"_top\">Tour Software</a>');
											document.write('</div>');
											document.write('<div class=\"section\">');
												document.write('<div class=\"box\">');
													document.write('<table width=\"220\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" bgcolor=\"#98B8D8\">');
													document.write('<tr><td onclick=\"gotourl(\'vts_overview.html\')\"><a href=\"vts_overview.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Software Overview</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'vts_studio.html\')\"><a href=\"vts_studio.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Easypano Studio 2010</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'vts_pwoverview.html\')\"><a href=\"vts_pwoverview.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Easypano Panoweaver</a></td></tr>');
													//document.write('<tr><td onclick=\"gotourl(\'vts_pwgallery.html\')\"><a href=\"vts_pwgallery.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Panoweaver Gallery</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'vts_twoverview.html\')\"><a href=\"vts_twoverview.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Easypano Tourweaver</a></td></tr>');
													//document.write('<tr><td onclick=\"gotourl(\'vts_gallery.html\')\"><a href=\"vts_gallery.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Tourweaver Gallery</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'vts_download.html\')\"><a href=\"vts_download.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Software Downloads</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'https://www.erealtyweb.net/tours/ordervts.aspx?plan=4\')\"><a href=\"vts_download.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Order Now!</a></td></tr>');
													document.write('</table>');
													document.write('<!--<iframe src=\"submenu_vts.html\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" width=\"160\" height=\"160\"></iframe>-->');
												document.write('</div>');
											document.write('</div>');
										document.write('</td>');
										document.write('<td width=\"7\">|</td>');

										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"vth_overview.html\" target=\"_top\">Tour Hosting</a>');
											document.write('</div>');
											document.write('<div class=\"section\">');
												document.write('<div class=\"box\">');
													document.write('<table width=\"200\" border=\"0\" cellspacing=\"0\" cellpadding=\"2\" bgcolor=\"#98B8D8\">');
													document.write('<tr><td onclick=\"gotourl(\'vth_overview.html\')\"><a href=\"vth_overview.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Hosting Overview</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'vthosting.html\')\"><a href=\"vthosting.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Tour Viewer Features</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'gallery.html\')\"><a href=\"gallery.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Tour Gallery</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'plancompare.html\')\"><a href=\"plancompare.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Compare Plans</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'https://www.erealtyweb.net/tours/userlogin.aspx\')\"><a href=\"https://www.erealtyweb.net/tours/userlogin.aspx\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Member Login</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'https://www.erealtyweb.net/tours/ordervth.aspx?plan=2\')\"><a href=\"https://www.erealtyweb.net/tours/ordervth.aspx?plan=2\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Order Now!</a></td></tr>');
													document.write('</table>');
													document.write('<!--<iframe src=\"submenu_vth.html\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" width=\"140\" height=\"120\"></iframe>-->');
												document.write('</div>');
											document.write('</div>');
										document.write('</td>');
										document.write('<td width=\"7\">|</td>');
										
										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"gallery.html\" target=\"_top\">Gallery</a>');
											document.write('</div>');
											document.write('<div class=\"section\">');
												document.write('<div class=\"box\">');
													document.write('<table width=\"200\" height=\"80\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#98B8D8\">');
													document.write('<tr><td onclick=\"gotourl(\'gallery.html\')\"><a href=\"gallery.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;eRealtyweb Template Gallery</a></td></tr>');

													document.write('<tr><td onclick=\"gotourl(\'vts_gallery.html\')\"><a href=\"vts_gallery.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Tourweaver Gallery</a></td></tr>');
													document.write('<tr><td onclick=\"gotourl(\'vts_pwgallery.html\')\"><a href=\"vts_pwgallery.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Panoweaver Gallery</a></td></tr>');
													document.write('</table>');
													document.write('<!--<iframe src=\"submenu_gallery.html\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" width=\"160\" height=\"80\"></iframe>-->');
												document.write('</div>');
											document.write('</div>');
										document.write('</td>');
										document.write('<td width=\"7\">|</td>');
										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"support.html\" target=\"_top\">Support</a>');
											document.write('</div>');
										document.write('</td>');
										document.write('<td width=\"7\">|</td>');
										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"aboutus.html\" target=\"_top\">Company</a>');
											document.write('</div>');
											document.write('<div class=\"section\">');
												document.write('<div class=\"box\">');
													document.write('<table width=\"200\" height=\"60\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#98B8D8\">');
													document.write('<tr><td onclick=\"gotourl(\'aboutus.html\')\"><a href=\"aboutus.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;About eRealtyweb</a></td></tr>');

													document.write('<tr><td onclick=\"gotourl(\'contact.html\')\"><a href=\"contact.html\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Contact eRealtyweb</a></td></tr>');
													document.write('</table>');
													document.write('<!--<iframe src=\"submenu_company.html\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\" width=\"140\" height=\"60\"></iframe>-->');
												document.write('</div>');
											document.write('</div>');
										document.write('</td>');
										document.write('<td width=\"7\">|</td>');
										document.write('<td>');
											document.write('<div class=\"top\" align=\"center\">');
												document.write('<a href=\"https://www.erealtyweb.net/tours/userlogin.aspx\" target=\"_top\">Login</a>');
											document.write('</div>');
											document.write('<div class=\"section\">');
												document.write('<div class=\"box\">');
													document.write('<table width=\"200\" height=\"20\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\" bgcolor=\"#98B8D8\">');
													document.write('<tr><td onclick=\"gotourl(\'https://www.erealtyweb.net/tours/userlogin.aspx\')\"><a href=\"https://www.erealtyweb.net/tours/userlogin.aspx\" target=\"_parent\"><img src=\"tri.gif\" border=0>&nbsp;Virtual Tour Hosting</a></td></tr>');
													document.write('</table>');
													document.write('<!--<iframe src=\"submenu_login.html\" frameborder=\"0\" marginheight=\"0\" marginwidth=\"0\" scrolling=\"no\"  width=\"160\" height=\"40\"></iframe>-->');
												document.write('</div>');
											document.write('</div>');
										document.write('</td>');
									document.write('</tr>');
								document.write('</table>');
							document.write('</div>');
						document.write('</td>');
					document.write('</tr>');
					document.write('<tr>');
						document.write('<td bgcolor=\"#98B8D8\"><img src=\"images/space.gif\" height=\"1\" width=\"750\" alt=\"\" hspace=\"0\" vspace=\"0\" border=\"0\"></td>');
					document.write('</tr>');
				document.write('</table>');

				document.write('<script>');
					document.write('menuInit();');
				document.write('</script>');
				document.write('</TD>');
			document.write('</tr>');
		document.write('</TABLE>');
	document.write('</div>');
}
