// GLOBAL VARIABLE

//document.onLoad

// SEARCH FIELD FOCUS

	function brdr(obj,clr){
		obj.style.borderColor = clr;
		}

// LEFT NAV BEHAVIOUR

	//ALL OPEN

		function Opa()
			{
			for (var i = 0; i < document.links.length; i++)
				{				
				if (document.links[i].className == "leftlinksRBDR")
					{
					window.document.getElementById('LNVtgl').innerHTML = "<a href='javascript:Cla()'><img src='/assets/img/arr3.gif' alt='arrow icon'>collapse all</a>";
					document.links[i].parentNode.childNodes[2].style.display = 'block';
					}
				}
			}
	//ALL CLOSED
		function Cla()
			{
			for (var i = 0; i < document.links.length; i++)
				{				
				if (document.links[i].className == "leftlinksRBDR")
					{
					window.document.getElementById('LNVtgl').innerHTML = "<a href='javascript:Opa()'><img src='/assets/img/arr3.gif' alt='arrow icon'>expand all</a>";
					document.links[i].parentNode.childNodes[2].style.display = 'none';
					}
				}
			}

	//TOGGLES CHILD DIVS=========================
		function bgon(obj){
			if (obj.parentNode.childNodes[2].style.display != 'block')
			{
			obj.parentNode.childNodes[2].style.display = 'block';
			}
			else
			{
			obj.parentNode.childNodes[2].style.display = 'none';
			}
		}

	//DIV BY ID OPEN=========================

		function Odiv(objid){
			window.document.getElementById(objid).style.display = 'block';
			}

//ICONS POP UP INFO======================

	function popMe(e,objid){
		window.document.getElementById('INFODIV').style.top = parseInt(document.body.scrollTop+e.clientY+10)+'px';
		window.document.getElementById('INFODIV').style.left = e.clientX+'px';
		window.document.getElementById(objid).style.display = 'block';
		}

	function popMeLarge(e,objid){
		window.document.getElementById('INFODIV').style.top = parseInt(document.body.scrollTop+e.clientY+10)+'px';
		window.document.getElementById('INFODIV').style.left = (e.clientX - 400) + 'px';
		window.document.getElementById(objid).style.display = 'block';
		}





	function icn(icnTheme){

	var ICOhdng = "";
	var ICOico = "";
	var ICOtxt = "";
var ICNalllnk = "<br /><a href='iconinfo.asp' target='_self' class='sml' style='color:#fff;margin:0px 0px 0px 1px'><img src='/assets/img/arr3.gif' align='middle' alt='arrow icon' style='margin:0px 3px 0px 0px'>Click to view ALL icon definitions</a>"

	//ORGANIC
		if(icnTheme == 'O')
			{
			ICOhdng = 'Organic';
			ICOico = 'O';
			ICOtxt = 'Materials grown and products made without the use of pesticides, fertilizers or hazardous chemicals. All our clothing and baby basics are 100 per cent organic. Much of our skincare includes organic ingredients. See product description for details.';
			}
	//BEST SELLER
		if(icnTheme == 'B')
			{
			ICOhdng = 'Best seller';
			ICOico = 'B';
			ICOtxt = 'Our customers love these products and buy them time and time again.';
			}
	//RECYCLED
		if(icnTheme == 'R')
			{
			ICOhdng = 'Recycled';
			ICOico = 'R';
			ICOtxt = 'Made, or part made, from recycled materials; at minimum the packaging is made from recycled material. See product description for details.';
			}
	//HAND MADE
		if(icnTheme == 'H')
			{
			ICOhdng = 'Hand made';
			ICOico = 'H';
			ICOtxt = 'Made by crafts men and women using traditional skills such as hand spinning, handloom, wood turning, knitting and dyeing. See product description for details.';
			}
	//SUSTAINABLE
		if(icnTheme == 'S')
			{
			ICOhdng = 'Sustainable';
			ICOico = 'S';
			ICOtxt = 'Made using raw materials from sustainably managed forests where at least as many trees are planted as are harvested to protect both the environment and future livelihoods. See product description for details.';
			}
	//FAIRLY TRADED
		if(icnTheme == 'F')
			{
			ICOhdng = 'Fairly traded';
			ICOico = 'F';
			ICOtxt = 'Producers receive fair prices and terms of business, enabling them to plan long-term, use sustainable production practices, support their families and send their children to school. See product description for details.';
			}
	//WITHOUT
		if(icnTheme == 'W')
			{
			ICOhdng = 'Without';
			ICOico = 'W';
			ICOtxt = 'Made without certain ingredients that raise health concerns. Clothing: poppers made without nickel (which can irritate skin). Skincare: Made without parabens (a preservative, of growing concern since being found in cancer tissue), and without SLS (Sodium Lauryl Sulphate - and Sodium Laureth Sulphate - a very widely used chemical that can irritate skin). See product description for details.';
			}
		window.document.getElementById('INFODIVhdng').innerHTML = "<div class='ICN_" + ICOico + "' style='padding:6px'>" + ICOhdng + ICNalllnk + "</div>";
		window.document.getElementById('INFODIVdesc').innerHTML = ICOtxt;
		window.document.getElementById('icoDIV').innerHTML = "<a href='javascript://' class='ICN_" + ICOico + "' style='padding:2px'>" + ICOico +"</a>";
		embiggen('small')
		}

// CLOSE POPUP STUFF===================

	function cls(objid){
		window.document.getElementById('INFODIV').style.display='none';
		embiggen('small')
		}
		
// SUPPLIER INFORMATION POPUP CODE
	function supplierinfo(splrid, splrname, splrtext, splrhasimg) {
		window.document.getElementById('INFODIVhdng').innerHTML = "<div class='ICN_SPLR' style='padding:6px'>" + splrname + "</div>";
		if(splrhasimg == '1') 
			{
			window.document.getElementById('INFODIVdesc').innerHTML = "<img src='assets/img/supplier/supplier-" + splrid + "-tn.jpg' align='left' style='margin: 10px;' alt='Image of " + splrname + "' /><br /> " + splrtext;
		}else{
			window.document.getElementById('INFODIVdesc').innerHTML = splrtext;
			}
		window.document.getElementById('icoDIV').innerHTML = "";
	}

	function countryinfo(splrid, splrname, splrtext, splrhasimg) {
		window.document.getElementById('INFODIVhdng').innerHTML = "<div class='ICN_SPLR' style='padding:6px'>" + splrname + "</div>";
		if(splrhasimg == '1') 
			{
			window.document.getElementById('INFODIVdesc').innerHTML = "<img src='assets/img/supplier/country-" + splrid + "-tn.jpg' style='margin: 10px;' alt='Image of " + splrname + "' /><br /> " + splrtext;
		}else{
			window.document.getElementById('INFODIVdesc').innerHTML = splrtext;
			}
		window.document.getElementById('icoDIV').innerHTML = "";
	}
	
// Enlarge the div
	//the popup div embiggens the smallest man
	function embiggen(bigorsmall) {
		if(bigorsmall == 'big'){
			window.document.getElementById('INFODIV').style.width='500px';
			window.document.getElementById('INFODIVTABLE').style.width='500px';
			window.document.getElementById('INFODIVdesc').style.width='500px';
		}else{
			window.document.getElementById('INFODIV').style.width='300px';
			window.document.getElementById('INFODIVTABLE').style.width='300px';
			window.document.getElementById('INFODIVdesc').style.width='300px';
		}
	}
	
// GIFT CHECKOUT

	function gift(obj){
		if (window.document.getElementById('giftsel').value == 'gift')
			{
			window.document.getElementById('giftwrap').style.display = 'block';
			}
			else
			{
			window.document.getElementById('giftwrap').style.display = 'none';
			}
		}

// THUMBNAIL ZOOM

	function showPic(obj){
		window.document.getElementById('mainImg').src = obj.src;
		}



