function stripHTML(oldString) {

   var newString = "";
   var inTag = false;
   for(var i = 0; i < oldString.length; i++) {
   
        if(oldString.charAt(i) == '<') inTag = true;
        if(oldString.charAt(i) == '>') {
              if(oldString.charAt(i+1)=="<")
              {
              		//dont do anything
	}
	else
	{
		inTag = false;
		i++;
	}
        }
   
        if(!inTag) newString += oldString.charAt(i);

   }

   return newString;
}
  function JSONscriptRequest(fullUrl) {
      this.fullUrl = fullUrl; 
      this.noCacheIE = '&noCacheIE=' + (new Date()).getTime();
      this.headLoc = document.getElementsByTagName("head").item(0);
      this.scriptId = 'YJscriptId' + JSONscriptRequest.scriptCounter++;
  }
  JSONscriptRequest.scriptCounter = 1;
  JSONscriptRequest.prototype.buildScriptTag = function () {
      this.scriptObj = document.createElement("script");    
      this.scriptObj.setAttribute("type", "text/javascript");
      this.scriptObj.setAttribute("src", this.fullUrl + this.noCacheIE);
      this.scriptObj.setAttribute("id", this.scriptId);
  }
  JSONscriptRequest.prototype.removeScriptTag = function () {
      this.headLoc.removeChild(this.scriptObj);  
  }

  JSONscriptRequest.prototype.addScriptTag = function () {
      this.headLoc.appendChild(this.scriptObj);
  }
  function getExchangeRates(value) {
    value = value.replace(",",".");
  	if (value > 0) {
  		//var xxdiv = Math.floor(Math.random()*99999999);
  		//document.write("<span id='xxresult_"+xxdiv+"'></span>");
  		//document.getElementById('xxresult_'+xxdiv).innerHTML = "<span style='color: #cccccc;'>Calculating ... please wait</span>";
  		request = 'http://currencyconverter.55uk.net/currencyxml.json.php?xfrom=EUR&xto=GBP&xvalue='+value+'&xround=true&callback=updatePrice&mydiv=lame';
  		aObj = new JSONscriptRequest(request);
  		aObj.buildScriptTag();
  		aObj.addScriptTag();		
  	}
  }
  function updatePrice(response){
      var newprice = stripHTML(response.ResultSet);
      //alert(newprice);
      //newprice = newprice.split('.');
      //newprice = newprice[0]+"."+newprice[1].substr(0,2);
      document.getElementById('denom').style.display = 'none';
      document.getElementById('actprice').innerHTML= "&pound;"+newprice+" (estimated)";
  }