        $(document).ready(function() {
		initBinding();
        $('#left').s3Slider({
            timeOut: 5500
        });
		$('#right').s3Slider({
            timeOut: 4000
        });
		var is_chrome = navigator.userAgent.toLowerCase().indexOf('chrome') > -1;
		if (is_chrome) {
			document.getElementById("rightContent").style.left="62px";
			document.getElementById("rightContent").style.top="12px";
		}
//start dialog
	$('#linksbox').dialog({
	autoOpen: false,
	width: 300,
	title: "Websites I\'ve Coded",
	open:  function() {
		$('#wrapper').fadeTo("fast", 0.33);
	},
	close:  function() {
		$('#wrapper').fadeTo("fast", 1);
	}
	
	});
	//end
	
	
$('#dialog_link').click(function(){
	$('#linksbox').dialog('open');
	return false;
});

$('#dialog_link, ul#icons li').hover(
	function() { $(this).addClass('ui-state-hover'); }, 
	function() { $(this).removeClass('ui-state-hover'); }
);

$(function() {
	$("a", ".llinks").click(function() { return false; });
});
//end dialog
    });
	//endofready
	
	
	
	
	function ajx(urlx,container){
				$.ajax(
					{
						url: urlx,
						success: function(html)
						{
							$("#"+container).empty().append(html);
							//rebind hover
							initBinding();
						}
				});
	}
	function initBinding() {
			$("a").hover(function() {
			$(this).next("em").stop(true, true).animate({opacity: "show", top: "-200"}, "slow");
			}, function() {
			$(this).next("em").animate({opacity: "hide", top: "-0"}, "fast");
			}); 
	}
	/***********************************************
    * Dynamic Ajax Content- © Dynamic Drive DHTML code library (www.dynamicdrive.com)
    * This notice MUST stay intact for legal use
    * Visit Dynamic Drive at http://www.dynamicdrive.com/ for full source code
    ***********************************************/

    var loadedobjects=""
    var rootdomain="http://"+window.location.hostname

    function ajaxpage(url, containerid){
    var page_request = false
    if (window.XMLHttpRequest) // if Mozilla, Safari etc
    page_request = new XMLHttpRequest()
    else if (window.ActiveXObject){ // if IE
    try {
    page_request = new ActiveXObject("Msxml2.XMLHTTP")
    } 
    catch (e){
    try{
    page_request = new ActiveXObject("Microsoft.XMLHTTP")
    }
    catch (e){}
    }
    }
    else
    return false
    page_request.onreadystatechange=function(){
    loadpage(page_request, containerid)
    }
    page_request.open('GET', url, true)
    page_request.send(null)
	
	//check for below_1 style 2 pages
	if (url=="spd.html" || url=="lmspd.html" || url=="stirling.html" || url=="lmstirling.html" || url=="anim.html") {
		document.getElementById("below_l").style.height=800+"px";
	}
	else {
		document.getElementById("below_l").style.height="auto";
	}
    }
	//replace leftMiddle and below_l
	function loaddivs(url,containerID) {
		ajx(url,containerID);
		vurl="lm"+url;
		ajaxpage(vurl,"leftMiddle");
	}	
    function loadpage(page_request, containerid){
    if (page_request.readyState == 4 && (page_request.status==200 || window.location.href.indexOf("http")==-1))
    document.getElementById(containerid).innerHTML=page_request.responseText
    }

    function loadobjs(){
    if (!document.getElementById)
    return
    for (i=0; i<arguments.length; i++){
    var file=arguments[i]
    var fileref=""
    if (loadedobjects.indexOf(file)==-1){ //Check to see if this object has not already been added to page before proceeding
    if (file.indexOf(".js")!=-1){ //If object is a js file
    fileref=document.createElement('script')
    fileref.setAttribute("type","text/javascript");
    fileref.setAttribute("src", file);
    }
    else if (file.indexOf(".css")!=-1){ //If object is a css file
    fileref=document.createElement("link")
    fileref.setAttribute("rel", "stylesheet");
    fileref.setAttribute("type", "text/css");
    fileref.setAttribute("href", file);
    }
    }
    if (fileref!=""){
    document.getElementsByTagName("head").item(0).appendChild(fileref)
    loadedobjects+=file+" " //Remember this object as being already added to page
    }
    }
    }
	function large(imgn) {
		for (i=1;i<=5;i++)
		{
			var istrx=(i.toString());
			var xx ="im"+istrx;
			if (xx==imgn) {
				$("#"+imgn).toggleClass("big");
			}
			else {
				var idd="im"+istrx;
				document.getElementById(idd).setAttribute("class", "thumb");
				//$("#"+"im"+istrx).toggleClass("thumb");
			}
		}
	}
	function bup(imgn) {
		$("#bigp").html('<img id="bigpi" src="images/white.jpg"> <span id="sptxt">Spring Loaded Rail Bearing</span>');
		var idiv=document.getElementById('bigpi');
		var isrc=document.getElementById(imgn);
		idiv.src=isrc.src;
		var yyy=$("#"+imgn).attr("alt");
		$("#sptxt").html(yyy);
	}	
	function bup1(imgn) {
		$("#bigp2").html('<img id="bigpi2" src="images/applications.jpg"> <span id="sptxt"></span>');
		var idiv=document.getElementById('bigpi2');
		var isrc=document.getElementById(imgn);
		idiv.src=isrc.src;
		var yyy=$("#"+imgn).attr("alt");
		$("#sptxt2").html(yyy);
	}
	function showanim() {
		var idiv=document.getElementById('bigp');
		
	}

