function getClientWidth()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientWidth:document.body.clientWidth;
}

function getClientHeight()
{
  return document.compatMode=='CSS1Compat' && !window.opera?document.documentElement.clientHeight:document.body.clientHeight;
}

selffuncshow=false;
timeoutID=0;

toset=false;

function qmout(){
	tmOut = setTimeout("$('soapmenu').hide();", 2000);
}

function qmxy(){
if(window.tmOut) clearTimeout(tmOut);
xy=$('quicktd').cumulativeOffset();
h=$('soapmenu').getHeight();
$('soapmenu').absolutize();
$('soapmenu').style.left=(xy[0]+13)+'px';
$('soapmenu').style.top=(xy[1]-h+33)+'px';
$('soapmenu').show();
}

function qmxypr(id){
  if (!toset){
	if(window.tmOut) clearTimeout(tmOut);
	xy=$("prodspan"+id).cumulativeOffset();
	$('soapmenu').absolutize();
	if (xy[0]+415>getClientWidth()) xy[0]=getClientWidth()-415;
	if (xy[0]<10) xy[0]=10;
	$('soapmenu').style.left=xy[0]+'px';
	$('soapmenu').style.top=(xy[1]-330)+'px';
	$('textsm').update($('textdiv'+id).innerHTML);
	$('showall').update($('stextdiv'+id).innerHTML);
	$('soapmenu').show();
	}
}

function ajax_response(originalRequest) {
$("desc").innerHTML="";
$("desccont").scrollUpdate();
//alert(originalRequest.responseText);
eval(originalRequest.responseText);
$("desc").update(textdesc);
$("desccont").scrollUpdate();
}

function ajax_request(url, data) {
 var myAjax = new Ajax.Request(
     url,
     {method: 'post', parameters: data, encoding: "win-1251", onComplete: ajax_response}
 );
}

function showsoap(id){

ajax_request("/be_soap.php?id="+id+"&g2s="+g2s+"&catid="+catid+"&curid="+curid+"&subcat="+subcat,"");
}

function showsolt(id){
ajax_request("/be_soap.php?id="+id+"&g2s="+g2s+"&catid="+catid+"&curid="+curid+"&subcat="+subcat,"");
}

/* Browser detection code by Kruglov */
isDOM=document.getElementById //DOM1 browser (MSIE 5+, Netscape 6, Opera 5+)
isOpera=isOpera5=window.opera && isDOM //Opera 5+
isOpera6=isOpera && window.print //Opera 6+
isOpera7=isOpera && document.readyState //Opera 7+
isMSIE=document.all && document.all.item && !isOpera //Microsoft Internet Explorer 4+
isMSIE5=isDOM && isMSIE //MSIE 5+
isNetscape4=document.layers //Netscape 4.*
isMozilla=isDOM && navigator.appName=="Netscape" //Mozilla или Netscape 6.*
/* End code */


/* Div scroll by Pimenov Dmitriy */
var timer;
var divWidth = 300;
var scrollWidth = 0;
var scrollSpeed = 3;
var scrollStep = 50;

if(isNetscape4 || isMozilla)
{
        scrollWidth = 18;
}
else
{
        scrollWidth = 16;
}


function sethover(id){

   var arr=$('namescont').childElements();
   arr.each(function(node){
      node.setStyle('background: URL("/img/cream/namebg.png") no-repeat top center;');
	  aaa=node.childElements();
	  
		aaa.each(function(node1){
			node1.setStyle('color: #745247;');
			}
		);
	});

$(id).setStyle('background: URL("/img/cream/namebgh.png") no-repeat top center;');
	  aaa=$(id).childElements();
	  		aaa.each(function(node1){
			node1.setStyle('color: #FFFFFF;');
			}
		);
}

