var req;
function getComment(current, a) {
        var url = "/individualcomment/"+current+"/"+a;
        if(window.XMLHttpRequest) {
                req = new XMLHttpRequest();
        } else if(window.ActiveXObject) {
                req = new ActiveXObject("Microsoft.XMLHTTP");
        }
        req.open("GET", url, true);
        req.onreadystatechange = callback;
        req.send(null);
}

function callback() {        
	if (!document.getElementById) return;
	obj = document.getElementById("individualComment");
//	setFade(0);
	if(req.readyState == 4) {
		if(req.status == 200) {
			response = req.responseText;
			obj.innerHTML = response;
//            replaceBlockHeadingWithFlash('blockHeadingComment', 'ffffff', 'C9C07B', 140, 0, 18, 0.1);
//			fade(100); 
		} else {
		alert("There was a problem retrieving the data:\n" + req.statusText);
		}
	}	
}

function fade(amt) {
	if(amt <= 100) {
		setFade(amt);
		amt += 10;
		setTimeout("fade("+amt+")", 5);
    }
}

function setFade(amt) {
	obj = document.getElementById("individualComment");
	amt = (amt == 100)?99.999:amt;
	obj.style.filter = "alpha(opacity:"+amt+")";
	obj.style.KHTMLOpacity = amt/100;
	obj.style.MozOpacity = amt/100;
	obj.style.opacity = amt/100;
}

function shortenP(){
	if (!document.getElementById) return;
	obj = document.getElementById("secondpart");
	objDot = document.getElementById("extraDot");
	objControl = document.getElementById("readmore");
	if (obj.className=="hideSecondpart") { obj.className="showSecondpart"; objDot.innerHTML=""; objControl.innerHTML="Close"; objDot.parentNode.className="displayInline"; }
	else { obj.className="hideSecondpart"; objControl.innerHTML="Read more"; objDot.innerHTML="...";}
}


var reqAmazon;
function amazon(current){
	var url = "/amazon/"+current;
	if(window.XMLHttpRequest) {
			reqAmazon = new XMLHttpRequest();
	} else if(window.ActiveXObject) {
			reqAmazon = new ActiveXObject("Microsoft.XMLHTTP");
	}
	reqAmazon.open("GET", url, true);
	reqAmazon.onreadystatechange = amazonCallback;
	reqAmazon.send(null);
}
function amazonCallback() {        
	if (!document.getElementById) return;
	obj = document.getElementById("amazonWrap");
	if(reqAmazon.readyState == 4) {
		if(reqAmazon.status == 200) {
			response = reqAmazon.responseText;
			obj.innerHTML = response;
		} else {
		alert("There was a problem retrieving the data:\n" + reqAmazon.statusText);
		}
	}	
}
