﻿var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;

if (checkIt('konqueror'))
{
	browser = "Konqueror";
	OS = "Linux";
}
else if (checkIt('safari')) browser = "Safari"
else if (checkIt('omniweb')) browser = "OmniWeb"
else if (checkIt('opera')) browser = "Opera"
else if (checkIt('webtv')) browser = "WebTV";
else if (checkIt('icab')) browser = "iCab"
else if (checkIt('msie')) browser = "Internet Explorer"
else if (checkIt('firefox')) browser = "Firefox"
else if (!checkIt('compatible'))
{
	browser = "Netscape Navigator"
	version = detect.charAt(8);
}
else browser = "An unknown browser";

if (!version) version = detect.charAt(place + thestring.length);

function checkIt(string)
{
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}


sound1='audio/home.mp3';
sound2='audio/services.mp3';
sound3='audio/examples.mp3';
sound4='audio/contact.mp3';
sound5='audio/bio.mp3';
sound6='audio/links.mp3';
sound7='audio/blog.mp3';



if (browser == "Safari"){

	document.write('<embed src="' + sound1 + '" autostart=false hidden=true name="sound1"enablejavascript="true">');
	document.write('<embed src="' + sound2 + '" autostart=false hidden=true name="sound2"enablejavascript="true">');
	document.write('<embed src="' + sound3 + '" autostart=false hidden=true name="sound3"enablejavascript="true">');
	document.write('<embed src="' + sound4 + '" autostart=false hidden=true name="sound4"enablejavascript="true">');
    document.write('<embed src="' + sound5 + '" autostart=false hidden=true name="sound5"enablejavascript="true">');
    document.write('<embed src="' + sound6 + '" autostart=false hidden=true name="sound6"enablejavascript="true">');	
    document.write('<embed src="' + sound7 + '" autostart=false hidden=true name="sound7"enablejavascript="true">');
	function playsound(soundobj) {
	
		var thissound= document[soundobj];
		thissound.Play();
	}
}


if (browser == "Firefox"){
   var sound;
    function playsound(surl) {
        if (surl=="sound1"){
            sound = sound1;

        }
        else if (surl=="sound2") sound = sound2
        else if (surl=="sound3") sound = sound3
        else if (surl=="sound4") sound = sound4
        else if (surl=="sound5") sound = sound5
        else if (surl=="sound6") sound = sound6
        else if (surl=="sound7") sound = sound7
        
        document.getElementById("audiospan").innerHTML=
        "<embed src='"+sound+"' hidden=true autostart=true loop=false>";
    }
}


if (browser == "Internet Explorer" && version > 4 && document.all) {

	
	document.write('<bgsound src="#" id=mysound loop=1 autostart="true">');

	function playsound(thesound) {
	
		var thesound= eval(thesound);
		document.all.mysound.src = thesound;
	}
}

if (browser == "Netscape Navigator") {

	//
}