function refresh() {
   var item = document.getElementById('iconrefresh');
   item.src='/i/i_refresh_a.gif';
}


function opensLink(SID, PID, LINK)
{
	var width  = 505;
	var height = 515;
	var scrx=window.screen.availWidth;
 	var scry=window.screen.availHeight;
  	var vleft=(scrx-width)/2;
   	var vtop =(scry-height)/2;
	window.open("/slink.php?LINK="+LINK+"&SID="+SID+"&PID="+PID,"","directories=0, resizable=no, menubar=no, status=no, toolbar=no, location=no, scrollbars=no, Width="+width+",Height="+height+",Left="+vleft+",Top="+vtop+"");
}

function overLink()
{
   var b = check_browser();
   if (b>1)
   	document.getElementById('link').style.cursor = "pointer";
   else
   	document.getElementById('link').style.cursor = "hand";

   document.getElementById('link').style.textDecoration = "underline";
}

function outLink()
{
   var b = check_browser();
   if (b>1)
   	document.getElementById('link').style.cursor = "pointer";
   else
   	document.getElementById('link').style.cursor = "hand";

   document.getElementById('link').style.textDecoration = "none";
}



function check_browser() {
		var version = 0;
		if (navigator.userAgent.indexOf ("MSIE") != -1)
			 version = 1;
		else if (navigator.userAgent.indexOf ("Opera") != -1)
			 version = 2;
		else if (navigator.userAgent.indexOf ("Mozilla/5.0") != -1)
			 version = 3;
		else if (navigator.userAgent.indexOf ("Mozilla/4.7") != -1)
			 version = 4;
		else version = 8;

		return version;
}
function opencur(l)
{
  if ( (document.getElementById(l).style.display == '') || (document.getElementById(l).style.display == 'inline') )
  {
    document.getElementById(l).style.display = "none";
  }
  else
    document.getElementById(l).style.display = "inline";

}

//--------------------------------------------------------------------------
var arHttp = false;
/*@cc_on @*/
/*@if (@_jscript_version >= 5)
try {
  arHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    arHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    arHttp = false;
  }
}
@end @*/
if (!arHttp && typeof XMLHttpRequest != 'undefined') {
  arHttp = new XMLHttpRequest();
}

function callReviews(id)
{                         
  	  var url = "/services/reviews.php?id="+id;
	  arHttp.open("GET", url, true);
	  arHttp.onreadystatechange = updatePageReviews;
	  arHttp.send(null);
}
function callReviews_n(id)
{                         
      var url = "/services/reviews_n.php?id="+id;
      arHttp.open("GET", url, true);
      arHttp.onreadystatechange = updatePageReviews;
      arHttp.send(null);
}
function callReviews_in(id)
{                         
      var url = "/services/reviews_in.php?id="+id;
      arHttp.open("GET", url, true);
      arHttp.onreadystatechange = updatePageReviews;
      arHttp.send(null);
}


function updatePageReviews()
{
   if (arHttp.readyState == 4)
   {
     window.status = '';
     var response = arHttp.responseText;
     document.getElementById("div_reviews").innerHTML = response;
   }
   else
   	window.status  = "Идет загрузка данных, подождите...";
}

