// JavaScript Document
	var active_image = '';
	var alt_text;
	function returnDirectory(){
		var dirs=window.location.href.split('/'),
		cdir=dirs[dirs.length-2];
		return cdir;
	}
	
	function returnDocument() {
        var file_name = document.location.href;
        var end = (file_name.indexOf("?") == -1) ? file_name.length : file_name.indexOf("?");
        return file_name.substring(file_name.lastIndexOf("/")+1, end);
    } 
	function setlink(){
		var file=returnDocument();
		var pref="faq_";
		file = pref+file;
		return file;
	}
	function backswitch(){
		//alert("TESTING");
		var doc = new Array("about","portfolio","services","client","map","links","contact");
		for(var i = 0; i<doc.length; i++){
			if(returnDocument().match(doc[i]+".html") != null || returnDocument().match(doc[i]+".php") != null){
				var x = document.getElementById(doc[i]);
				//alert("IN HERE "+doc[i]);
				//alert("url(images/nav/"+doc[i]+"_btn_over.gif) \nurl(images/nav/about_btn_over.gif)")
				x.style.backgroundImage = "url(images/nav/"+doc[i]+"_btn_over.gif)"
			}
		}
	}
	function linkme(){
		var files = Array("bamboo.html","rapid_loc.html","engwood.html");
		var files2 = Array("faq_bamboo.html","faq_rapid_loc.html","faq_engwood.html");
		if("faq_gen.html" == returnDocument()){
				document.write("<a href='../js/faq.html' id='thelink'>View Main FAQ Page</a>");
			}
		for(var i = 0; i<files.length; i++){
			if(files[i] == returnDocument()){ 
				document.write("<a href='../js/"+setlink()+"' id='thelink'>View The Product Faq</a>");
			}
			else if(files2[i] == returnDocument()){
				var filelink=strip(files2[i]);
				document.write("<a href='../js/"+filelink+"' id='thelink'>View The Product Page</a>");
			}			
		}
	}
	function strip(str){
		var f = str.substr(4);
		return f;		
	}
	
	function load()
	{
		window.status="Page is loaded";
		alert("loaded")
	}


 	function showalt(){
		hidediv("theimage");
		hidediv("alt_text");		
		setTimeout('showalt2()',300);
	}
	function showalt2(){
		showdiv("alt");
	}
	
	
	function hidealt(){
		hidediv("alt");
		setTimeout('hidealt2()',300);		
	}
	function hidealt2(){
		showdiv("alt_text");		
		showdiv("theimage");
	}
	
	
	
   function hidediv(thediv) {
		$('#'+thediv).fadeOut(300);		
	}
	function showdiv(thediv) {
		$('#'+thediv).fadeIn(600);
	} 
	
	
	function setActiveImage(img){
		if(document.getElementById('alt_text') != undefined){
			hidealt();
		}
		hidediv('theimage');
		active_image = img;
		setTimeout('secondPart()',300);
	}
	
	function swapImage(img){
		document.getElementById("theimage").src = img;
		if(document.getElementById('alt_text') != undefined){
				alt_text = document.getElementById('alt_text').innerHTML;
				document.getElementById('alt_text').innerHTML = '';
		}
		
	}
	
	function secondPart(){
		img = active_image;
		swapImage(img);
		setTimeout('thirdPart()',200);
	}
	
	function thirdPart(){		
		showdiv('theimage');
	}
