
//create data object

var data3 = {
questions:[
 ["Still have a Question?"]
 ],
 answers: [
 [" Email us at  help@neighborrow.com "],
 ]

 };
var data2 = {
    questions: [
	["How does it work?"], 
	["Why would I lend something?"], 
	["How easy is it to add items?"], 
	["What can I borrow?"], 
	["How do I know I'll get it back in good condition (or at all)? "], 
	["What if there is a legitimate issue or dispute? "], 
	["How are the actual transactions executed? <br>- and -<br>  How do I actually get an item I want to borrow?"],
	["Can I get something right away, in \"real time\"?"], 
	["What\'s the incentive for third-party facilitators and Mayors?"], 
	["Is neighBORROW.com really free?"]
	],
    answers: [
	['<div><li>After you sign up for the site you will LIST YOUR ITEMS. You can tag each item as public or private, local (not willing or able to ship) or virtual (willing and able to put it in the mail). You will start accumulating a <a target="_blank" href="http://www.cityofboston.gov/rentalhousing/pdfs/handbook.pdf">rating</a> by listing items and you will continue to earn a <a target="_blank" href="http://www.cityofboston.gov/rentalhousing/pdfs/handbook.pdf">rating</a> and a "borrowing power" by everything you do on the site. <br/></li> 		<li>Join a neighBORROW-hood. neighBORROW-hoods act not only as the bond among people, but also the filter. Just like the items, neighBORROW-hoods are local or virtual, public or private. You should look for a local one first, by searching for your city or ZIP code... you can join as many as you want. Join one at work, one in your building, and perhaps a virtual one with a group of common enthusiasts or alumnae. (If there is no group for you to join, you can CREATE ONE, see the answer about Mayors)</li> 		<li>Once you are a member of a neighBORROW-hood, you can start to request items, and you may start receiving requests for your own items. Based on the type of neighBORROW-hood, you will confirm a request or see a confirmation, then deliver or receive the item according one of the many exchange scenarios.</li></div>'],		['So you can borrow something, of course! <b>You must list and lend things in order to borrow things in PUBLIC neighBORROW-hoods</b> there are no rules or minimums for PRIVATE groups. Without listing and lending requirements, everyone is worse off. These requirements help ensure that there will be plenty of things available for borrowing. There is no way to "buy" the right to borrow at neighBORROW, you have to earn it. The site is of the people, for the people, and most certainly BY the people. Those who lend just a little will be able to borrow quite a bit and those who lend a lot will be able to borrow much more, get special priorities on the site and may be entitled to other bonuses. Besides, it\'s fun, it\'s environmentally friendly, it\'s a good way to keep track of your stuff, and it\'s nice!' ], 	
	["On the navigation bar, there is a link to \"ADD MORE\" next to your list of things. For books, simply enter the ISBN number and ALL the information will be filled in automatically, even the cover! You can edit it later to tell us about the condition and things of that nature. For movies we have an auto-fill feature for titles. Just type the first few letters and we will figure out what you are typing. For miscellaneous items we have a growing checklist so you do not have to sit and type everything. We are doing everything we can to make the site as easy and convenient for you as possible. You can also browse through the site and add items from other Onlinebraries, just by clicking a button. If you have a huge collection, please contact us and we will help you out."], 	
	["<em>Short answer:</em>The content is supplied by you (the collective you... y\'all) not by us. As long as it\'s legal and \"lends\" itself to sharing, trading, or communal ownership, and it\'s available, borrow AWAY (or trade). Books, movies, games, tools, <a href=\"http://www.cruising-america.com/\" target=\"_blank\">camping</a> gear, toys, sporting equipment, electronics, chargers, adapters, headphones, baby items, cooking equipment, and much, much more!<br/><br/> <em>Longer answer:</em>Public items are categorized as either basic or premium. Basic items are items with a self-imposed value of up to $25. An item can be worth much more, but if it\'s listed as basic, it\'s subject to the rules for basic items. Private items have no categories. We believe the most popular items are things that people like to USE but don\'t need to OWN. Books that have been read and are sitting around collecting dust; movies that have been purchased and viewed (so members can avoid the costs of rental clubs or purchasing a new release that you plan to watch only once); video games that you\'ve already mastered; power tools; equipment that normally gets rented; even a boat or a vacation home one day! "], 	
	["Webutations. A comprehensive rating and reward system. Deposits. Due dates. Late return penalties. neighBORROW insurance. Active collateral  \"out \" on the system. Borrower screening. Selective lending. Private neighBORROWhoods.</a> "], 	
	["neighBORROW will not get involved in private group disputes. Those must be handled by the members or the Mayor.<br/><br/>In public groups, however, integrity rules at neighBORROW. The system was designed to allow the site's founders, staff, and fellow users to easily discern a legitimate claim from a fraudulent one. It is in our best interest to reward folks who follow the rules and to penalize those who do not.<br/><br/>If you are the type of user who appreciates, accepts and abides by the site's underlying philosophy, you should feel completely confident in taking full advantage of the capabilities of the system. Rest assured that we will make every effort to ensure that a good neighBORROW-er never gets burned, and to remedy the situation quickly and fairly if need be.<br/><br/>In order to do this, we reserve the right to cancel a member's account. An account that repeatedly finds itself involved with issues or disputes will be penalized, suspended, or completely terminated.<br/><br/>Plus, users will have the ability not only to reward each other but also to penalize each other. Warnings will have an immediate, binding and potentially permanent effect. Users will lose any deposit if they are removed from the site, so we expect everyone to treat this power seriously. You will be rewarded for inviting good neighbors to the site, and penalized if someone you invite to the site is a bad neighbor. "], 	
	["For all basic items, local neighBORROW-hood lending, borrowing, trading, and sharing will occur through a third party facilitator with whom an item can be left (e.g., doorperson, security guard), in person (e.g. in the lobby, at the cafe next door), or simply by dropping the item in the other person's mailbox or on their doorstep. We are also exploring the idea of drop boxes with temporary/single-use codes.</p>  <p>For virtual neighBORROW-hood transactions, we will offer integrated shipping that is trackable, insurable, and can be printed right from the website and mailed right from your home. The website takes care of pretty much everything.</p><p>In both cases, if you're the lender, all you have to do is approve the request and drop the item in the mail or bring it somewhere close. If you are the borrower, you just have to wait for the mail or pick up the item wherever it is left. "], 		
	["Yes."], 	
	["Technically, these people work for you, the user, and not for us. If your building, community or group has a person with whom you can leave a package, then this situation is no different. However, just as with any copyright issues, we will absolutely, under no circumstances, throw up our hands and say \"it\'s not our problem.\" If a certain building (or equivalent neighBORROW-hood) is suddenly overwhelmed with items, we have every intention of working with the building, the management company, and the people themselves to find a solution. This is one of the reasons we will encourage personal exchanges and may develop a drop box scenario in the future. The system was set up to keep individual neighBORROW-hoods manageable, around existing groups that have already formed naturally and that can accommodate everyone. Additional value will come when neighBORROW-hoods and neighBORROW-ers are linked together through the mail. "], 	
	["YES! It is completely free to borrow basic items within your neighBORROW-hood. It is free to enjoy the social networking services of the sites, free to keep track of your own collection, etc. As long as you maintain certain minimum member requirements, you will be free to enjoy all the benefits of your neighBORROW-hood. "]
		
	]
};

var data = {
    questions: [
	["What is neighBORROW.com?"],	
	["OK, how does the system work?"] ,
	["How does neighBORROW-ing help the environment? and What is so green about it?"] ,
	["What is a neighBORROW-hood?"] ,
	["What is a neighBORROW-good?"] ,
	["How do I join a neighBORROW-hood near me, what if there is no neighBORROW-hood near me?"] ,
	["Can I belong to more than on group?"] ,
	["What is makes this site different?"] ,
	["What's all the talk about being Mayor?"]  
	
	],
    answers: [
	["neighBORROW combines the traditional notion of borrowing a cup of sugar from a neighbor with modern technology,  using the Internet to faciliate borrowing and lending of nearly anything among people in existing local communities and other established networks. <br><br>another answer...<br><br> neighBORROW is a free, interactive web site that boasts a real-time, centralized and consolidated database that identifies books, movies, CDs, and other miscellaneous items that may be available to borrow in your apartment building, office building, neighborhood, school, place of worship or from any group of people imaginable."] ,
	["The web site instantaneously and electronically catalogs the aggregate collection of all of the items entered by its members into a searchable database. In essence, neighBORROW.com converts this group of neighbors, co-workers, classmates, (even verified strangers) into a fully functioning library of stuff. The user-friendly interface allows for searching and browsing, and facilitates communication between lenders and borrowers to coordinate real-world exchanges of available, actual things within a neighBORROW hood."] ,
	["When people buy things and use things more efficiently, there is less of a demand for natural resources needed to make these items. For example, if you borrow a book from a friend, rather than buying a copy of your own, you are helping to save the tree needed to make that book. Not to mention the CO2 used for production of other items. Also, since neighBORROW is local, much of the items are shared locally, reducing or eliminating the need for shipping. More generally, more efficient use and conscientious efforts to waste less, gets everyone in better habits and helps everyone realize that the earth's resources are not something that we can take for granted."] ,
	["A neighBORROW-hood is any group of people, anywhere in the world that wants to share with each other, for any reason.  Each neighBORROW is intimate and composed of people with whom you would be most likely to share. Then we add accountability, privacy, security and convenience so that you can expand your sharing radius! An example of a neighborrow-hood is a group of neighbors in an apartment building, pooling all their items (such as books, tools, movies, or something for the weekend or a vacation) into one online catalog, then exchanging these items in person or through the door person at the front desk. There are scores of other possible neighborrow-hoods. "] ,
	["neighBORROW-good is the term we use for things that are listed, borrowed, lent, traded, donated, and organized on the site. Anything from a paperback book to an airplane can be utilized more efficiently."] ,
	["You can use our maps or our searches to find a group. If you were invited by a friend or a link, simply follow the instructions provided. If there is no neighBORROW-hood near you, we will compensate you to create a new one."] ,
	["Absolutely. Our technology allows you to create new groups and join as many groups as you wish. There is a a group, even, that is composed of every member of the site who wishes and is qualified to join. It is very easy to maintain a single library - all you need to do is decide which items you want to share with everyone and which items you would prefer to share only with other members of your private group(s). You can change items back and forth at any time between public and private and as you feel more and more comfortable we hope you will make more and more items available to your public groups."] ,
	["neighBORROW is not a swapping site, it's not a site for getting rid of things you don't want anymore, and it's not just for movies, or books or tools, etc. neighBORROW is a comprehensive solution for purchasing, owning, and using ALL THINGS more efficiently."] ,
	["Mayors are vital to neighBORROW .com and play a critical role in both public and also private neighBORROW-hoods. In both cases, we are going to need some assistance \"from the inside.\" For private neighBORROW-hoods, the Mayor is automatically the first person in the group, the group's creator. This person will be responsible for inviting new members and accepting requests to join. No one can join a private group without permission from the Mayor or by using a special link or password. Private Mayors can also decide not to accept requests at all. In this case the group will be STRICTLY invitation only. For established public neighBORROW-hoods the selection process will be a democratic one. For newly created neighBORROW-hoods, the Mayor must apply to and be approved by neighBORROW.com. Mayors of private neighBORROW-hoods will enjoy potential free books and movies and public Mayors may be entitled to share advertising revenue generated by the traffic in their neighBORROW-hood"]  
	
	]
};
 


/* var data = {
    questions: [
	["11111111How does it work?"]
	],
    answers: [
	["11111111111ans."] 
	]
};

 var data2 = {
    questions: [
	["2222222222222"]
	],
    answers: [
	["22222222222222ans."] 
	]
};*/
/*
 * Variable Declaration
 */
var flashObj = '<script type="text/javascript">'+
'AC_FL_RunContent( \'codebase\',\'http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\',\'width\',\'605\',\'height\',\'30\',\'id\',\'neighborrow-banner\',\'align\',\'middle\',\'src\',\'flash/neighborrow-banner\',\'quality\',\'high\',\'bgcolor\',\'#ffffff\',\'name\',\'neighborrow-banner\',\'allowscriptaccess\',\'sameDomain\',\'pluginspage\',\'http://www.macromedia.com/go/getflashplayer\',\'movie\',\'flash/neighborrow-banner\' ); //end AC code'+
'</script><embed height="30" width="605" align="middle" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" allowscriptaccess="sameDomain" name="neighborrow-banner" bgcolor="#ffffff" quality="high" src="flash/neighborrow-banner.swf"/> <noscript><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="605" height="30" id="neighborrow-banner" align="middle">'+
'<param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="flash/neighborrow-banner.swf" /><param name="quality" value="high" /><param name="bgcolor" value="#ffffff" />'+
'<embed src="flash/neighborrow-banner.swf" quality="high" bgcolor="#ffffff" width="605" height="30" name="neighborrow-banner" align="middle" allowscriptaccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></embed>'+
'</object></noscript><br/><br/></div>';

var autoCompleteContainerHtml = "<div id='acFormContainer' class='acFormContainer'><br/>" +
"<div id='stage' class='hccStage'>" +
"<div id='ajaxLoaderDiv'  style='padding-top:100px;'><img src='/images/ajaxLoader.gif'/></div>" +
"</div>" +
"</div>";

var stageTable = "<div id='stageTable'></div>";

/*
 * Now begin dom manipulation
 */
var autoCompleteContainer = document.getElementById("autoCompleteContainer");
if (autoCompleteContainer) {
    //autoCompleteContainer.innerHTML = autoCompleteContainerHtml;
}


function reloader(mydata,datanum)
{
	
	//alert("dddddddd"+mydata);
 	//document.getElementById("tableHolder").style.display = 'none';
	//document.getElementById("ajaxLoaderDiv").style.display = 'block';
	//Effect.Fade('ajaxLoaderDiv', {duration: 1.0,from: 1,to: 0 });
	//Effect.Fade('stageTableHolder', {duration: 2.0,from: 0.0,to: 1});
	
	/*var autoCompleteContainer = document.getElementById("autoCompleteContainer");
	if (autoCompleteContainer) {
    	autoCompleteContainer.innerHTML = autoCompleteContainerHtml;
	}*/	

	//setTimeout("funcnav()", 500);
	loader(mydata,datanum);
	showHide(0);	
	//document.getElementById("ajaxLoaderDiv").style.display = 'none';
	
}


loader(data,1);

//Effect.Fade('ajaxLoaderDiv', {duration: 2.0, from: 1, to: 0 });
//Effect.Fade('stageTableHolder', {duration: 3.0, from: 0.0, to: 1});
	
//setTimeout("funcnav()", 1500);
showHide(0);	

function loader(mydata,datanum){
 	//alert(data);	
	//alert(data2);
	// 	alert(buildTableContents(mydata));	
	var strtable = buildTableContents(mydata ,datanum);
    
	newDiv  ='<div align="center">'+
//'<table id="faderTable" width="600" cellspacing="0" cellpadding="0" border="0" style="opacity:0.01; filter:alpha(opacity=1);"><tbody><tr>'+
//'<td align="center"><a onfocus="this.blur();" onclick="showHide(0);" href="javascript:void(0);"><img src="images/block_1.gif" border="0"/></a></td>'+
//'<td align="center" id = "minitabs"><a  onfocus="this.blur();" onclick="showHide(1);reloader(data,1);" href="javascript:void(0);">Introductory Question</td>'+
//'<td align="center" id = "minitabs"><a onfocus="this.blur();" onclick="showHide(2);reloader(data2,2);" href="javascript:void(0);">Frequently Ask Question</a></td>'+
//'<td align="center" id = "minitabs"><a onfocus="this.blur();" onclick="showHide(3);reloader(data3,3);"  href="javascript:void(0);"> Ask Us</a></td>'+

//'<td align="center"><a onfocus="this.blur();" onclick="showHide(3);" href="javascript:void(0);"><img src="images/block_4.gif" border="0"/></a></td>'+
//'</tr></tbody></table><br/>'+
//'<div id="flashObj"></div>'+
"<table id='stageTable' class='stageTable' cellspacing='0' cellpadding='0' border='0' style='display:none; opacity:0.01; filter:alpha(opacity=1);'>" +  strtable + "</table>";
   // storeageII += " <div id='div" + x +"' class='togglea' onMouseOver='toggleColor(\"div" + x +"\");' onMouseOut='toggleColor(\"div" + x +"\");' >" +data.questions[x] + "</div>";	
    
    
    var autoCompleteContainer = document.getElementById("stageTableHolder");
    if (autoCompleteContainer) {
        autoCompleteContainer.innerHTML = newDiv;
        
    }
}

function buildTableContents(datavalue, datanum){
 	///alert(datavalue+"--"+datanum);
	//\"hook" + x + "\",\"div" + x + "\"
	//var test = 345;
  	var storage = "";
	         for (var x = 0; datavalue.questions[x]; x++) {
            storage += "<tr id='row" + x + "' class='togglea' onClick='clicky(\"hook" + x + "\",\"div" + x + "\","+datanum+")' onMouseOver='toggleColor(\"row" + x + "\");' onMouseOut='toggleColor(\"row" + x + "\");'>" +
            "<td width='20px'>" +
            "<font style='font-size:16px;'><strong><a id='x_o' href='javascript:void(0);'><STRONG>+</strong></a></strong></font>" +
            "</td>" +
            "<td>" +
            "<font style='font-size:12px;'><div class='hook' id='hook" +
            x +
            "'>" +
            datavalue.questions[x] +
            "</div></font>" +
            "</td>" +
            "</tr>";
        }
        return storage;  
}


function clicky(id, id2, datanum ){
	///alert(id+"---"+id2+"---"+datanum);
     shrinkAll();
    var x = id2.split("div");
    if (x[1]) 
        x = x[1];
    else 
        x = null;
    var divEl = document.getElementById(id);
    var results = search(divEl.innerHTML,datanum);
    var divDisplayAns = document.createElement('DIV');
    divDisplayAns.id = "divDisplayAns";
    divDisplayAns.name = "divDisplayAns";
    divDisplayAns.className = "divDisplayAns";
    var domAddress = document.getElementById(id2);
    if (divEl) {
        divEl.appendChild(divDisplayAns);
        divDisplayAns.innerHTML = "<div id='HCCslider" + x + "' style='background: url(/images/sliderBG.gif) repeat-x; border: 1px solid #000; width:650px; position: relative; opacity: 0; filter:alpha(opacity=1);'></div>";
        var c_ = document.createElement('DIV');
        c_.id = 'HCCslider' + x;
        //HCCslider
        
        Effect.Fade(c_.id, {
            duration: 1.0,
            from: 0,
            to: 1
        });
        
        var sli = document.getElementById(c_.id);
        if (sli) {
        
            var sliderTextWrapper = document.createElement('DIV');
            sliderTextWrapper.id = "sliderTextWrapper" + x;
            sli.appendChild(sliderTextWrapper);
            sliderTextWrapper.innerHTML = results;
            sliderTextWrapper.style.height = "auto";
            sliderTextWrapper.style.display = "none";
			sliderTextWrapper.style.padding = "10px"
			sliderTextWrapper.style.color = "#057eef";
           // sliderTextWrapper.style.backgroundColor = "#EAEAEA";
            
        }
        else {
        
        }
        Effect.Grow('sliderTextWrapper' + x);
        document.getElementById(sliderTextWrapper.id).innerHTML = results; //make this fade in
        //if(results) alert(results);  //comment this in to bring back the js clicky func  ALSO REMOVE THIS FOR PRODUCTION.. UNEEDED MEMORY 
    } 
}

function search(key,aa){	
	//alert(aa);
    var storage = "";
	if(aa==2)
	{
    	for (var x = 0; data2.questions[x]; x++) {
     	   if (data2.questions[x] == key && data2.answers[x]) {
            return data2.answers[x];
        	}
		}
    }
		else if(aa==3)
	{
		for (var x = 0; data3.questions[x]; x++) {
     	   if (data3.questions[x] == key && data3.answers[x]) {
            return data3.answers[x];
        	}
		}
	}
	else
	{
		for (var x = 0; data.questions[x]; x++) {
     	   if (data.questions[x] == key && data.answers[x]) {
            return data.answers[x];
        	}
		}
	}
}



function shrinkAll(){
    while (document.getElementById('divDisplayAns')) {
        var divDisplayAns = document.getElementById('divDisplayAns');
        var par = divDisplayAns.parentNode;
        Effect.Shrink(divDisplayAns);
        par.removeChild(divDisplayAns);
    }
}


function toggleColor(id){
    var dom = document.getElementById(id);
    if (dom) {
        window.focus = dom;
        var tmpClass = dom.className;
        if (tmpClass == "togglea") {
            dom.className = "toggleb";
        }
        else {
            dom.className = "togglea";
        }
    }
    
}


function insertFlash(){
var flsh = document.getElementById('flashObj');
if(flsh) {
	flsh.innerHTML += flashObj;
	flsh.appendChild(stageTable);
}
setTimeout("funcone()", 1000);

}
function funcnav(){
Effect.Fade('stageTableHolder', {duration: .5, from: 0.0, to: 1});
//setTimeout("insertFlash()", 1000);

}
function showHide(num){
if(num == 0)funcone();
else if(num == 1)funcone();
else if(num == 2)funcone();
else if(num == 3)funcone();
else funcone();

	
}
function funcone(){
    var stage = document.getElementById('stageTable');
    if (stage) 
        stage.style.display = "";
    Effect.Fade('stageTable', {
        duration: 1.0,
        from: 0.0,
        to: 1
    });
	
	
	//insert flashObj into div id flash Obj
}