// SG Internet Explorer Detection Script © 2007 Studio Gecko Interactive
// Ver 1.0
// Author: Andrei Gonzales
// Studio Gecko: http://www.studio-gecko.com
// This script is covered under the Creative Common's licence.
// Feel free to use and share this script on your website(s),
// but please do not resell nor claim this script as your own.
// If you are to modify this script, please do not state that
// it is still the work of Studio Gecko Interactive.
// However, we would appreciate a link back to the original file

// Script For Detecting Internet Explorer Versions 6 and below



function toggle_visibility(id) {
       var e = document.getElementById(id);
       if(e.style.display == 'block')
          e.style.display = 'none';
       else
          e.style.display = 'block';
    }
	
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];}
}

// Fucntion to launch browser update list
function closeBox() // Closes the Alert Div
	{
		
		if (document.getElementById) {
			document.getElementById('alert').style.visibility = 'hidden';
	} else {
		if (document.layers) {
			document.alert.visibility = 'hidden';
			} else {
			document.all.alert.style.visibility = 'hidden';
			}
		}
	}

function showAlert() // Displays the Alert Div when the browser version is detected
	{
			if (document.getElementById) {
				document.getElementById['alert'].style.visibility = 'visible';
			} else {
			if (document.layers) {
				document.alert.visibility = 'visible'; 
			} else {
				document.all.alert.style.visibility = 'visible';
			}
			}
	} 


function upgradeBox()
	{
			document.write('<div id="alert">')
			document.write('<div id="alertbox"><h3 id="upgrade">You are currently using an outdated Browser!</h3>')
			document.write('<p>This website was designed for the latest browser technology. &nbsp;')
			document.write('Because you are using a browser which is not&nbsp;')
			document.write('<a class="suggest" href="http://www.w3.org/" target="_blank">W3C (World Wide Web Consortium)</a> Standards Compliant, some elements may render incorrectly. &nbsp;')
			document.write('We strongly suggest that you upgrade your browser as soon as possible.</p>')
			document.write('<p><span id="list_title">Please install one of the browsers below:</span>')
			document.write('<ul>')
			document.write('<li><a class="suggest" href="http://www.mozilla.com/en-US/firefox/" target="_blank">Mozilla Firefox 2 (Recommended)</a></li>')
			document.write('<li><a class="suggest" href="http://www.apple.com/safari/download/" target="_blank">Apple Safari 3 (Recommended)</a></li>')
			document.write('<li><a class="suggest" href="http://browser.netscape.com/" target="_blank">Netscape Navigator 9</a></li>')
			document.write('<li><a class="suggest" href="http://www.opera.com/download/" target="_blank">Opera Web Browser 9</a></li>')
			document.write('<li><a class="suggest" href="http://www.microsoft.com/windows/downloads/ie/getitnow.mspx" target="_blank">Microsoft Internet Explorer 7 (if you must)</a></li>')
			document.write('</ul></p>')
			document.write('<a id="close" onclick="closeBox();">Continue Anyway</a>')
			document.write('</div>')
			document.write('</div>')
	}

// Detect Internet Explorer Versions Below IE7
version=0
	if (navigator.appVersion.indexOf("MSIE")!=-1)
		{
			temp=navigator.appVersion.split("MSIE")
			version=parseFloat(temp[1])
		}

// The script below is necessary in order to prevent the code from detecting browsers other than IE (Non-IE browsers return a 0 value)
	if (version > 0 && version < 7)
		{
			upgradeBox();
			showAlert();
		}