<!--
var req = new JsHttpRequest();
var lastOpenFrom = '';
function getInfoBuyProduct(productid)
{
//	alert(document.getElementById('top').clientWidth);
    sendProductInfoPost('/ajaxphp/getbuyproductinfo.php', productid);
}

function sendProductInfoPost(url, productid) {
    
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
			document.getElementById('messageBox').innerHTML = req.responseText;
			setObjPosition('message2', 'message1');
        }
    }
    req.open('GET', url, true);
    req.send( { productid: productid } );
}

function setObjPosition(obj, obj2){
	setx=0;
	sety=0;
	
	sety = getY(-50);
	setx = getX(-170);
	if(sety < 160) {
		sety = 160;
	}
	sety = 200;
	document.getElementById(obj).className="clcart ft11";
	document.getElementById(obj).style.left=setx;
	document.getElementById(obj).style.top=sety;
	document.getElementById(obj).style.position="absolute";

	document.getElementById(obj2).style.left=setx+10;
	document.getElementById(obj2).style.top=sety+10;
	document.getElementById(obj2).className="sbg";
	document.getElementById(obj2).style.position="absolute";

	document.getElementById('messageBox').className="";

}

function sendErrorMessage(producturl, errormessage)
{
    sendErrorMessagePost('/ajaxphp/senderrormessage.php', producturl, errormessage);
}

function sendErrorMessagePost(url, producturl, errormessage) {
    
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
		
			if(req.responseJS.confirmerror == 'ok'){
				document.getElementById('errorbox').innerHTML = '<b>' + req.responseText + '</b>';
			} else {
				document.getElementById('confirmerror').innerHTML = '<b>' + req.responseJS.confirmerror + '</b>';
			}
        }
    }
	
    req.open('POST', url, true);
    req.send( { error: producturl, mess: errormessage, verificationcode: document.forms['error'].verificationcode.value, confirmationcode: document.forms['error'].confirmationcode.value,  mode: 'send' } );
}

function getFormQuestions(formmode, productid)
{
	req.onreadystatechange = function() {
        if (req.readyState == 4) {
			if(lastOpenFrom != '') {
				document.getElementById(lastOpenFrom).innerHTML = '';
			}
			document.getElementById('formq').innerHTML = req.responseText;
			lastOpenFrom = 'formq';
        }
    }
	req.open('GET', '/ajaxphp/questionsgetform.php', true);
    req.send( { formmode: formmode , productid: productid} );
}

function getFormAnswer(formmode, questionid)
{
	req.onreadystatechange = function() {
        if (req.readyState == 4) {
			if(lastOpenFrom != '') {
				document.getElementById(lastOpenFrom).innerHTML = '';
			}
			document.getElementById('form_a_' + req.responseJS.questionid).innerHTML = req.responseText;
			lastOpenFrom = 'form_a_' + req.responseJS.questionid;
        }
    }
	req.open('GET', '/ajaxphp/questionsgetform.php', true);
    req.send( { formmode: formmode , questionid: questionid} );
}


function postQueations(formmode, productid) {
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
			document.getElementById('formq').innerHTML = req.responseText;
        }
    }
	
    req.open(null, '/ajaxphp/questionsgetform.php?formmode=' + formmode + '&productid=' + productid, true);
    req.send( { 'form': document.getElementById('formquestion') } );
}
function postComments(formmode, productid) {
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
			document.getElementById('formq').innerHTML = req.responseText;
        }
    }
	
    req.open(null, '/ajaxphp/questionsgetform.php?formmode=' + formmode + '&productid=' + productid, true);
    req.send( { 'form': document.getElementById('formcomment') } );
}
function postAnswer(formmode, questionid) {
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
			document.getElementById('form_a_' + req.responseJS.questionid).innerHTML = req.responseText;
        }
    }
	
    req.open(null, '/ajaxphp/questionsgetform.php?formmode=' + formmode + '&questionid=' + questionid, true);
    req.send( { 'form': document.getElementById('formanswer_' + questionid) } );
}
var starImgFill  = new Image();
starImgFill.src = '/pic/starfill.gif';

var starImgClear = new Image();
starImgClear.src = '/pic/starclear.gif';
function drawStars(id, n)
{

    	for (var i = 1; i <= 5; i++) {
    		var objS = document.getElementById('star_' + id + '_' + i);
    		if (n >= i) {
    		    objS.src = starImgFill.src;
    		} else {
    		    objS.src = starImgClear.src;
    		}
    	}
}

function ratingBlockText(action)
{
    if (action == 'onmouseover') {
		ol_width = 200;
        ol_hpos = LEFT;
		ol_textfontclass = "top_tox_name";
		ol_textfont = "Verdana";
		ol_textcolor = "#717171";
        return overlib('Нажмите на звездочку соответствующую Вашему баллу');
    } else if (action == 'onmouseout') {
        return nd();
    }
}
function setRating(productid, n)
{
	sendPostRating('/ajaxphp/productaddvote.php', productid, n);

	ratingBlockText('onmouseout');
	
	document.getElementById('stars' + productid).onmouseout = function (){}
	document.getElementById('stars' + productid).onmouseover = function (){}
	for (var i = 1; i <= 5; i++) {
		document.getElementById('starlink_' + productid + '_' + i).style.cursor = 'auto';
		document.getElementById('starlink_' + productid + '_' + i).onmouseover = function (){}
		document.getElementById('starlink_' + productid + '_' + i).onclick = function (){}
	}
    return false;
}

function sendPostRating(url, productid, rate) {
    
    req.onreadystatechange = function() {
        if (req.readyState == 4) {
            document.getElementById('rating_' + productid).innerHTML = req.responseText;
            document.getElementById('ratingBox_' + productid).style.width = "180px";
			
            drawStars(productid, req.responseJS.rating);
			document.getElementById('stars' + productid).onmouseout = function (){}
			document.getElementById('stars' + productid).onmouseover = function (){}
			
			for (var i = 1; i <= 5; i++) {
	  			document.getElementById('starlink_' + productid + '_' + i).onmouseover = function (){}
				document.getElementById('starlink_' + productid + '_' + i).onclick = function (){}
			}
        }
    }
    req.open("GET", url, true);
    req.send( { productid: productid, rate: rate } );
}
-->