/** tabbing function
 *  author : Leonard Adhitya
 *
 *
 */
 
function tabbing () {
   var urls = new Array("http://www.revitanail.co.nz/product-range/the-range/","http://www.revitanail.co.nz/nail-health/","http://www.revitanail.co.nz/promotions/","http://www.revitanail.co.nz/e-newsletter/","http://www.revitanail.co.nz/index.php?id=3");
   var images = new Array('p7','p6','p5','p4','p3');
   var img = "";
   var theurl = window.location.href;
   var taboff = "url(/fileadmin/templates/images/tab_off.gif)";
   var tabon = "url(/fileadmin/templates/images/tab_on.gif)";
   var found = false;
   //alert('aaaaaaaa');
   
   for(var i=0;i<urls.length;i++){
	   
	   if(urls[i] == theurl) { //if the url match do the tabbing img change
	       //alert('aaaaaaaa');
		   found = true;
		   img = document.getElementById(images[i]);
		   //alert('gg '+img.style.backgroundImage);
		   //alert('bbbbb '+img.style.background-image);
		   img.style.backgroundImage = taboff;
		   //alert('cccc '+img.style.backgroundImage);
		   if(i != 0) {//to change the default tab
			   //document.getElementById('p7').style.backgroundImage = tabon;
		   }
		   
		   break;
	   }
   }
   if(theurl == 'http://www.revitanail.co.nz/product-range/the-range/nail-strengthener-sensitive-apricot/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/top-coat/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/nailstrengthener/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/nail-strengthener-sensitive-pink/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/french-manicure-set/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/nourishing-oil/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/ridge-filler/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/french-manicure-set/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/base-coat/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/nailcolour/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/polish-remover/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/hand-nail-cream/' ||
	  theurl == 'http://www.revitanail.co.nz/product-range/the-range/french-manicure-set/') { //hardcoded for all the range pages to stay black
   
      found = true;
	  document.getElementById('p7').style.backgroundImage = taboff;
   }
   if(theurl == 'http://www.revitanail.co.nz/e-newsletter/thank-you/') {
	   found = true;
	  document.getElementById('p4').style.backgroundImage = taboff;
   }

    if(	  theurl == 'http://www.revitanail.co.nz/expert-tips/nailt/' ||
	  theurl == 'http://www.revitanail.co.nz/expert-tips/nailb/' ||
	  theurl == 'http://www.revitanail.co.nz/expert-tips/colour-manicure/' ||
	  theurl == 'http://www.revitanail.co.nz/expert-tips/french-manicure/' ||
	  theurl == 'http://www.revitanail.co.nz/expert-tips/nail-health/' ||
	  theurl == 'http://www.revitanail.co.nz/expert-tips/faq-s/') { //hardcoded for all the pages to stay black
      found = true;
	  document.getElementById('p6').style.backgroundImage = taboff;
   }
   
   
   if(!found){ //default page tab  
	   //document.getElementById('p7').style.backgroundImage = tabon; 
   }
      
}
