function getPercentage(){
var checkDivs = document.getElementsByTagName("*");
var index = 0;//
var thatId;
var x;
var y;
var z;
var display;
/////////////////////////////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////EXPLORER & CHROME///////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////////////////////////////////////
if(document.all || BrowserDetect.browser == "Chrome"){
for (index=0; index<=checkDivs.length; index++) {
	
if(document.domain == "mrsnuff.com"){//usd if	
	if(checkDivs[index].id == "save_price"){
     x = checkDivs[index].innerText;
	 x = x.replace("You save: $","");
	 x = eval(x);
}//end if
if(checkDivs[index].id == "msrp"){
	 y = checkDivs[index].innerText;
	 y = y.replace("$","");
	 y = eval(y);
}//end if
if(checkDivs[index].id == "save_percent"){
	 display = Math.round(x/y*100);
     display = display + "% OFF";
     z = display;
	 checkDivs[index].innerText = z ; 	
}//end if

if (checkDivs[index].className == "inStock") {
 thatId = checkDivs[index].innerHTML;
 thatId = thatId.replace('N/A','<strong style="color:black;">Pre Order</strong>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
        
if (checkDivs[index].id == "inStock") {
 thatId = checkDivs[index].innerText;
 thatId = thatId.replace('Stock:0','<strong style="color:red;">On order</strong>');
 //confirm(thatId);
 checkDivs[index].innerHTML = thatId;
 		}//end if
}// end usd if 	
////////////////////////////////////////////////////////////////////////////////////////////////////	
if(document.domain == "mrsnuff.co.uk"){//pound if	
	if(checkDivs[index].id == "save_price"){
     x = checkDivs[index].innerText;
	 x = x.replace("You save: \u00a3","");
	 x = eval(x);
}//end if
if(checkDivs[index].id == "msrp"){
	 y = checkDivs[index].innerText;
	 y = y.replace("\u00a3","");
	 y = eval(y);
}//end if
if(checkDivs[index].id == "save_percent"){
	 display = Math.round(x/y*100);
     display = display + "% OFF";
     z = display;
	 checkDivs[index].innerText = z ; 	
}//end if

if (checkDivs[index].className == "inStock") {
 thatId = checkDivs[index].innerHTML;
 thatId = thatId.replace('N/A','<strong style="color:black;">Pre Order</strong>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
        
if (checkDivs[index].id == "inStock") {
 thatId = checkDivs[index].innerText;
 thatId = thatId.replace('Stock:0','<strong style="color:red;">On order</strong>');
 //confirm(thatId);
 checkDivs[index].innerHTML = thatId;
 		}//end if
}// end pound if 
///////////////////////////////////////////////////////////////////////////////////////////////////////

if(document.domain == "mrsnuff.eu"){//euro if	
	if(checkDivs[index].id == "save_price"){
     x = checkDivs[index].innerText;
	 x = x.replace("You save: \u20ac","");
	 x = eval(x);
}//end if
if(checkDivs[index].id == "msrp"){
	 y = checkDivs[index].innerText;
	 y = y.replace("\u20ac","");
	 y = eval(y);
}//end if
if(checkDivs[index].id == "save_percent"){
	 display = Math.round(x/y*100);
     display = display + "% OFF";
     z = display;
	 checkDivs[index].innerText = z ; 	
}//end if

if (checkDivs[index].className == "inStock") {
 thatId = checkDivs[index].innerHTML;
 thatId = thatId.replace('N/A','<strong style="color:black;">Pre Order</strong>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
        
if (checkDivs[index].id == "inStock") {
 thatId = checkDivs[index].innerText;
 thatId = thatId.replace('Stock:0','<strong style="color:red;">On order</strong>');
 //confirm(thatId);
 checkDivs[index].innerHTML = thatId;
 		}//end if
}// end euro if 
	}//end for 
}//end if

///////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////MOZILLA//////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////////////////////////////////
else{
for (index=0; index<=checkDivs.length; index++) {
	
if(document.domain == "mrsnuff.com"){//usd if
if(checkDivs[index].id == "save_price"){
	//alert("Save Price");
     x = checkDivs[index].textContent;
	 x = x.replace("You save: $","");
	 x = eval(x);
	 }//end if
	 
if(checkDivs[index].id == "msrp"){
	 y = checkDivs[index].textContent;
	 y = y.replace("$","");
	 y = eval(y);
	 }//end if
	 
if(checkDivs[index].id == "save_percent"){
	 display = Math.round(x/y*100);
     display = display + "% OFF";
     z = display;
	 checkDivs[index].textContent = z;
	 }//end if	
 
if (checkDivs[index].id == "inStock") {
 thatId = checkDivs[index].innerHTML;
 thatId = thatId.replace('<strong>Stock:0','<b style="color:red;">On order</b>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
               	 
if (checkDivs[index].className == "inStock") {
 thatId = checkDivs[index].textContent;
 thatId = thatId.replace('N/A','<b style="color:blue;"> Pre Order</b>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
}//end usd if
///////////////////////////////////////////////////////////////////////////////////////////////////
if(document.domain == "mrsnuff.co.uk"){//pound if
if(checkDivs[index].id == "save_price"){
	//alert("Save Price");
     x = checkDivs[index].textContent;
	 x = x.replace("You save: \u00a3","");
	 x = eval(x);
	 }//end if
	 
if(checkDivs[index].id == "msrp"){
	 y = checkDivs[index].textContent;
	 y = y.replace("\u00a3","");
	 y = eval(y);
	 }//end if
	 
if(checkDivs[index].id == "save_percent"){
	 display = Math.round(x/y*100);
     display = display + "% OFF";
     z = display;
	 checkDivs[index].textContent = z;
	 }//end if	
 
if (checkDivs[index].id == "inStock") {
 thatId = checkDivs[index].innerHTML;
 thatId = thatId.replace('<strong>Stock:0','<strong style="color:red;">On order');
 checkDivs[index].innerHTML = thatId;
 		}//end if
               	 
if (checkDivs[index].className == "inStock") {
 thatId = checkDivs[index].textContent;
 thatId = thatId.replace('N/A','<b style="color:blue;"> Pre Order</b>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
  }//end pound if
  
////////////////////////////////////////////////////////////////////////////////////////////////////  

if(document.domain == "mrsnuff.eu"){//euro if
if(checkDivs[index].id == "save_price"){
	//alert("Save Price");
     x = checkDivs[index].textContent;
	 x = x.replace("You save: \u20ac","");
	 x = eval(x);
	 }//end if
	 
if(checkDivs[index].id == "msrp"){
	 y = checkDivs[index].textContent;
	 y = y.replace("\u20ac","");
	 y = eval(y);
	 }//end if
	 
if(checkDivs[index].id == "save_percent"){
	 display = Math.round(x/y*100);
     display = display + "% OFF";
     z = display;
	 checkDivs[index].textContent = z;
	 }//end if	
 
if (checkDivs[index].id == "inStock") {
 thatId = checkDivs[index].innerHTML;
 thatId = thatId.replace('<strong>Stock:0','<strong style="color:red;">On order');
 checkDivs[index].innerHTML = thatId;
 		}//end if
               	 
if (checkDivs[index].className == "inStock") {
 thatId = checkDivs[index].textContent;
 thatId = thatId.replace('N/A','<b>Pre Order</b>');
 checkDivs[index].innerHTML = thatId;
 		}//end if
  }//end euro if
}//end for 

	}//end else	
  
    
 }//end func
 window.onload = function(){setLoginText();getPercentage();}//