hej har dette rigtig lange javascript
<script type="text/javascript">
var xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
function StockEval()
{
url = CurrencyReturnUrl + '&rawxml=1&uniqid=' + new Date().getTime();
xmlDoc.async="false";
xmlDoc.onreadystatechange=Response;
xmlDoc.load(url);
xmlObj=xmlDoc.documentElement;
}
function Response()
{
if (xmlDoc.readyState != 4)
{
return false;
}
}
StockEval();
var thisform = '';
//function b3bcust(thisform)
//{
if(document.getElementById('Table48'))
{
var isloggedin = document.getElementById('Table48').innerHTML;
isloggedin = removeHTMLTags(isloggedin);
var loginok = isloggedin.match('Du er nu logget ind, og MEDLEMSRABAT er fratrukket ALLE varer');
if(loginok)
{
if(document.getElementById('FrontPageTopImage'))
{
document.getElementById('FrontPageTopImage').outerHTML = '<img src="/images/forside/Forhandler.jpg" id="FrontPageTopImage">';
}
if(parseInt(xmlObj.childNodes(18).text) > 1)
{
document.getElementById('AMOUNT').outerHTML = '<INPUT TYPE="TEXT" CLASS="TextInputField_ProductInfo" ID="AMOUNT" NAME="amount" SIZE="3" MAXLENGTH="6" VALUE="3">';
}
if(thisform == '')
{
if(document.getElementById('AMOUNT'))
{
if(document.getElementById('AMOUNT').value == 1)
{
if(parseInt(xmlObj.childNodes(18).text) > 1)
{
document.getElementById('AMOUNT').value = 3;
}
}
}
} else {
if(parseInt(xmlObj.childNodes(18).text) > 1)
{
thisform.AMOUNT.value = 3;
}
}
if(document.getElementById('ContentContainer_DIV'))
{
tdcount = 1;
tdnum3 = 1;
for(itemcount = 1; itemcount < 30; itemcount++)
{
var matchstr = document.getElementById('ContentContainer_DIV').innerHTML;
var keymatch = '&dec=1';
var tdmatchstring = matchstr.match('TD vAlign=top align=right');
var tdmatchstring3 = matchstr.match('TD vAlign=top align=middle');
for(tdnum = tdcount; tdnum <= tdcount+3; tdnum++)
{
if(tdcount < 60)
{
tdcount++;
}
document.getElementById('ContentContainer_DIV').innerHTML = document.getElementById('ContentContainer_DIV').innerHTML.replace(tdmatchstring, tdmatchstring + ' id=itemno' + tdnum);
document.getElementById('ContentContainer_DIV').innerHTML = document.getElementById('ContentContainer_DIV').innerHTML.replace(tdmatchstring3, tdmatchstring3 + ' id=item' + tdnum);
tdid = 'itemno' + tdnum;
tdid3 = 'item' + tdnum3;
if(document.getElementById('itemnotdnum').innerHTML == 3)
{
if(document.getElementById('itemtdnum3'))
{
document.getElementById('itemtdnum3').innerHTML = document.getElementById(tdid3).innerHTML.replace(keymatch,'');
}
}
var intvalue = tdnum/3;
if(isInteger(intvalue) == true)
{
tdnum3++;
}
}
}
}
}
}
//}
function isInteger(s) {
return (s.toString().search(/^-?[0-9]+$/) == 0);
}
function removeHTMLTags(strInputCode)
{
strInputCode = strInputCode.replace(/&(lt|gt);/g, function (strMatch, p1){
return (p1 == "lt")? "<" : ">";
});
var strTagStrippedText = strInputCode.replace(/<\/?[^>]+(>|$)/g, "");
return strTagStrippedText;
}
var CanBuy = true;
function BuyProduct(thisform, MinBuyAmount, MaxBuyAmount,BundleMinBuy) {
var isloggedin = document.getElementById('Table48').innerHTML;
isloggedin = removeHTMLTags(isloggedin);
var loginok = isloggedin.match('Du er nu logget ind, og MEDLEMSRABAT er fratrukket ALLE varer');
if(loginok)
{
if(thisform.AMOUNT.value == 1)
{
if(parseInt(xmlObj.childNodes(18).text) > 1)
{
//thisform.AMOUNT.value = 3;
}
}
}
if (BundleMinBuy=='True')
{
// MinBuyAmount in bundle mode
if (parseInt(thisform.AMOUNT.value) % parseInt(MinBuyAmount) > 0)
{
thisform.AMOUNT.value = MinBuyAmount;
alert(MinBuyMsg + '( '+MinBuyAmount+' )')
return (false);
}
if (isNaN (parseInt(thisform.AMOUNT.value)))
{
thisform.AMOUNT.value = MinBuyAmount;
alert(MinBuyMsg + '( '+MinBuyAmount+' )')
return (false);
}
}
else
{
// MinBuyAmount in normal mode
if (parseInt(thisform.AMOUNT.value) < parseInt(MinBuyAmount))
{
thisform.AMOUNT.value = MinBuyAmount;
alert(MinBuyMsg + '( '+MinBuyAmount+' )')
return (false);
}
if (isNaN (parseInt(thisform.AMOUNT.value)))
{
thisform.AMOUNT.value = MinBuyAmount;
alert(MinBuyMsg + '( '+MinBuyAmount+' )')
return (false);
}
}
if (parseInt(MaxBuyAmount) > 0 ) {
if (parseInt(thisform.AMOUNT.value) > parseInt(MaxBuyAmount)) {
thisform.AMOUNT.value = MinBuyAmount;
alert(MaxBuyMsg + ' ( '+MaxBuyAmount+' )')
return (false);
}
}
if (!CanBuy)
{
alert(SelectVarMsg);
}
return (CanBuy);
}
//b3bcust();
</script>
som bliver ved med at fejle, får bare følgende fejlmeddelse (et objekt er obligatorisk)
linjen den skriver der er fejl i er følgende
if(document.getElementById(tdid).innerHTML == 3)
men kan bare ikke lige se hvad der skulle være galt der.
håber der er nogle som kan hjælpe