function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function pp_popup(){
// Pop up for "People Positive"
    var heading = "What is People Positive?";
//	var text = "The purchase of People Positive products benefits the people who produce them in any or all of these ways: by creating opportunity for marginalized populations in the U.S. and throughout the world; preserving cultural traditions or crafts that are being lost; or creating sustainable economic development through practices such as fair trade, sweatshop-free, or other models of ethical sourcing.";
	var text = "People Positive products are those that benefit the people  who produce them in any or all of the following ways:<ul type=\"disc\" style=\"margin-top:0; padding-top:10px\"><li style=\"margin-top:0; padding-top:0\">Create opportunities for marginalized populations throughout the world and in the U.S., OR</li><li>Create sustainable economic development through practices such as fair trade,       sweatshop-free, or other models of ethical sourcing, OR</li><li>Preserve cultural traditions or crafts that are being lost</li></ul>";
	
	document.write("<div id=\"MyThing\"><div id=\"PeoplePositive\">\n");
    document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
    document.write("<tr><td class=\"body2\" valign=\"bottom\"><font color=\"#9A9A04\"><b>&nbsp;&nbsp;&nbsp;&nbsp;" + heading + "</b></font></td><td height=\"24\" align=\"right\">\n");
	document.write("<a href=\"#\"  onclick=\"MM_showHideLayers('PeoplePositive','','hide'); return false;\" >");
	document.write("<img src=\"http://pics.ebaystatic.com/aw/pics/row/art/shared/ns/space.gif\" width=\"30\" height=\"24\" border=\"0\"/></a></td></tr>\n");
    document.write("<tr valign=\"top\"><td colspan=2><table width=\"88%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n");
	document.write("<tr><td height=\"6\"> <td><tr>\n");
    document.write("<tr> <td class=\"body2\">\n");
    document.write(text); 
    document.write("</p></td></tr></table></td></tr></table></div></div>\n");
}

function tp_popup(){
// Pop up for "People Positive"
    var heading = "What are Trust Providers?";
//	var text = "The purchase of People Positive products benefits the people who produce them in any or all of these ways: by creating opportunity for marginalized populations in the U.S. and throughout the world; preserving cultural traditions or crafts that are being lost; or creating sustainable economic development through practices such as fair trade, sweatshop-free, or other models of ethical sourcing.";
	var text = "Trust Providers are membership organizations with a stated mission of promoting social or ecological good. They operate with a clearly stated, publicly available set of standards for verification, certification, or monitoring of their members, which are independent producers or sellers, or of products.";
	
	document.write("<div id=\"MyThing\"><div id=\"TrustProviders\">\n");
    document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
    document.write("<tr><td class=\"body2\" valign=\"bottom\"><font color=\"#9A9A04\"><b>&nbsp;&nbsp;&nbsp;&nbsp;" + heading + "</b></font></td><td height=\"24\" align=\"right\">\n");
	document.write("<a href=\"#\"  onclick=\"MM_showHideLayers('TrustProviders','','hide'); return false;\" >");
	document.write("<img src=\"http://pics.ebaystatic.com/aw/pics/row/art/shared/ns/space.gif\" width=\"30\" height=\"24\" border=\"0\"/></a></td></tr>\n");
    document.write("<tr valign=\"top\"><td colspan=2><table width=\"88%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n");
	document.write("<tr><td height=\"6\"> <td><tr>\n");
    document.write("<tr> <td class=\"body2\">\n");
    document.write(text); 
    document.write("</p></td></tr></table></td></tr></table></div></div>\n");
}

function ep_popup(){
// Pop up for "People Positive"
    var heading = "What is Eco Positive?";
	var text = "Eco Positive products are those that, when compared to  conventional products, benefit the ecological preservation of the planet and  its species through their materials, production processes, use, or lifecycle  engineering. Eco Positive products:<ul type=\"disc\" style=\"margin-top:0; padding-top:5px; margin-right:0; padding-right:0px\"><li  style=\"margin-top:0; padding-top:0px\">Are composed of ecologically sound materials, such as recycled materials, sustainably harvested natural materials, OR</li><li>Are created using ecologically beneficial processes, such as non-mechanized production, organic or biodynamic growth process, OR</li><li>When compared to conventional products, reduce environmental impact through their use, such as solar powered, energy efficient, reduction of environmentally sensitive materials, OR</li><li>Support the preservation of a species or ecological location in the way they are made, such as from rainforest preservation groups, etc., OR</li><li>Are designed with an eco-effective lifecycle in mind, resulting in minimal waste through recycling, upcycling, or composting after use. </li></ul>";
	
	document.write("<div id=\"MyThing\"><div id=\"EcoPositive\">\n");
    document.write("<table width=\"100%\" border=\"0\" cellspacing=\"0\" cellpadding=\"0\">\n");
    document.write("<tr><td class=\"body2\" valign=\"bottom\"><font color=\"#9A9A04\"><b>&nbsp;&nbsp;&nbsp;&nbsp;" + heading + "</b></font></td><td height=\"20\" align=\"right\">\n");
	document.write("<a href=\"#\"  onclick=\"MM_showHideLayers('EcoPositive','','hide'); return false;\" >");
	document.write("<img src=\"http://pics.ebaystatic.com/aw/pics/row/art/shared/ns/space.gif\" width=\"30\" height=\"20\" border=\"0\"/></a></td></tr>\n");
    document.write("<tr valign=\"top\"><td colspan=2><table width=\"88%\" border=\"0\" align=\"center\" cellpadding=\"0\" cellspacing=\"0\">\n");
	document.write("<tr><td height=\"6\"> <td><tr>\n");
    document.write("<tr> <td class=\"body2\">\n");
    document.write(text); 
    document.write("</p></td></tr></table></td></tr></table></div></div>\n");
}

function filter(x){
	document.getElementById('myWord').innerHTML = "";
	if (x == "open"){
		document.getElementById('myWord').innerHTML = "<span id=\"myWord\" class=\"more\">. <a href=\"#\" onClick=\"shoh('second'); return false;\" class=\"more\">&lt;&lt; less</a></span>";
	}
	else  {
		document.getElementById('myWord').innerHTML = "<span id=\"myWord\" class=\"more\">... <a href=\"#\" onClick=\"shoh('second'); return false;\" class=\"more\">more &gt;&gt;</a></span>";
	}
}
//show OR hide funtion depends on if element is shown or hidden
function shoh(id) { 

	if (document.getElementById) { // DOM3 = IE5, NS6
		if (document.getElementById(id).style.display == "none"){
			document.getElementById(id).style.display = 'block';
			filter('open');			
		} else {
			filter('close');		
			document.getElementById(id).style.display = 'none';			
		}	
	} else { 
		if (document.layers) {	
			if (document.id.display == "none"){
				document.id.display = 'block';
				filter('open');		
			} else {
				filter('close');
				document.id.display = 'none';
			}
		} else {
			if (document.all.id.style.visibility == "none"){
				document.all.id.style.display = 'block';
			} else {
				filter('close');
				document.all.id.style.display = 'none';
			}
		}
	}
}

function CopyToClipboard(x) 
{
holdtext.innerText = x;
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
alert("Banner code has been copied to clipboard. Do CTL-V (PC) or CMD-V (Mac) to paste in place.");
}

function writeInfo(x){
	for (var i=0; i<x.length; i++) {
        document.writeln("<div style=\"height:110px\">");
		document.writeln("<div id=\"box96by96\"><a href=\"" + x[i].url + "\"><img src=\"" + x[i].logo + "\" width=\"96\" height=\"96\" border=\"0\" /></a></div>");
		document.writeln("<div id=\"custComment\" class=\"body1\"><a href=\"" + x[i].url + "\"><b>" + x[i].name + "</b></a><br />");
		if (x[i].blurb) { 
			document.writeln(x[i].blurb + ".. ");
			document.writeln("<span class=\"more\"><a href=\"" + x[i].url + "\"><nobr>more &gt;&gt;</nobr></a></span>");
		}
		document.writeln("</div></div>");	
	}
}


function randomPic(){
	var randomnumber=Math.floor(Math.random()*9);
	document.write("<img src=\"http://pics.ebaystatic.com/aw/pics/row/art/shared/ns/_theme"+randomnumber+".jpg\" width=\"250\" height=\"220\" />");
}