// JavaScript Document

<!--PDF HIDE-->
		jQuery(document).ready(function(){
    
			jQuery("h4.hideButton").click(function () {
				jQuery("ul#pdfLanguage").slideToggle("slow");
		});

		});
		
<!--TECH SPECS HIDE-->
		jQuery(document).ready(function(){
    
			jQuery("h4.hideSpecs").click(function () {
				jQuery("h4.techSpecs").slideToggle("slow");
		});

		});
		
<!--ASSOCIATED COMPANIES HIDE-->
		jQuery(document).ready(function(){
    
			jQuery("h4.associatedBtn").click(function () {
				 jQuery(this).parent(".articleDiv").children().children("span.assosHide").slideToggle("normal");
		});
			
			

		});

<!-- Advance Menu Toggle Function -->

		jQuery(document).ready(function(){
    
			jQuery("a.advanceMenuBtn").click(function () {
				jQuery("div#advanceMenu").slideToggle("slow");
		});

		});


<!-- Advance Menu Hint Function -->

		jQuery(document).ready(function(){
		
			jQuery("div#advanceMenu").hide();

		});

<!--JAVASCRIPT SLIDESHOW START-->
//<![CDATA[
		jQuery(function() {
			if (jQuery.browser.ie && jQuery.browser.version < 8)
				jQuery('<span>&#9658;</span>').prependTo('kbd');
			if (jQuery.browser.ie && jQuery.browser.version < 7 || jQuery.browser.safari && jQuery.browser.version < 600)
				jQuery('#menu a').hover(function() {
					jQuery(this).next().show();
				}, function() {
					jQuery(this).next().hide();
				});
		});
	//]]>
    
    
//<![CDATA[
  function displaySource(name) {
    jQuery('<pre>'
        + jQuery('#source-' + name).html() // $(<script>).text() is broken on IE 5
            .replace(/^\s*|\s*$/g, '')
            .split('\n').slice(2, -2).join('\n')
            .replace(/(\/\/.*)/g, '<i>$1</i>')
        + '</pre>')
      .insertAfter('#display-' + name);
  }
//]]>
<!--JAVASCRIPT SLIDESHOW END-->

<!--//--><![CDATA[//><!--

sfHover = function() {
	var sfEls = document.getElementById("mainNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
	
	var sfEls = document.getElementById("advanceList").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);

//--><!]]>

<!-- CLEAR THIS SCRIPT -->

function clearText(thefield){
if (thefield.defaultValue==thefield.value)
thefield.value = ""
}

<!-- FILL THIS SCRIPT -->

function fillText(thefield){
if (thefield.value=="")
thefield.value = thefield.defaultValue
}

<!-- PASSWORD TYPE SCRIPT -->

function passwordText(pastype){
if (pastype.defaultValue==pastype.value)
pastype.value = ""

if(pastype.type == 'text')
pastype.type = 'password';
}

<!-- PASSWORD REVERSE SCRIPT -->

function TextPassword(pastype){
if (pastype.value=="")
pastype.value = pastype.defaultValue

if(pastype.type == 'password')
pastype.type = 'text';
}

function makeRequest(url, parameters)
{
    var http_request = false;
    if (window.XMLHttpRequest) { // Mozilla, Safari,...
        http_request = new XMLHttpRequest();
        if (http_request.overrideMimeType)
        {
            http_request.overrideMimeType('text/xml');
        }
    }
    else if (window.ActiveXObject) { // IE
        try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
        } catch (e) {
            try {
                http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
        }
    }
    if (!http_request) {
        //alert('Cannot create XMLHTTP instance');
        return false;
    }
    
    http_request.onreadystatechange = function() {
        if (http_request.readyState == 4) {
            if (http_request.status == 200) {
                // alert(http_request.responseText);
            } else {
                //alert('There was a problem with the request.');
                //alert(http_request.responseText);
            }
        } 
    };
    http_request.open('GET', url + parameters, true);
    http_request.send();
}

function sendMessage(to)
{
    makeRequest('../public-functions/sendmessage.php', '?to=' + to);
   // win = window.open('mailto:' + to, 'EmailWindow');
   // if(win && win.open && !win.closed) win.close();
}