var ie=(document.all && document.all.item && !window.opera)?1:0;

//////////////////////

	function t(myId){
		for (i=0;i<=2;i++)
		document.all['d'+i].style.display='none';
		document.all['d'+myId].style.display='block';


		s = document.all['img'+myId].src;
		l = s.length;
		s = s.substr(0,l-5);

		v = document.all['arr'+myId].src;
		l = v.length;
		v = v.substr(0,l-5);

		document.all['td'+myId].style.backgroundImage = 'url(images/m_but.jpg)';
		document.all['arr'+myId].src = v + '.gif';
		document.all['img'+myId].src = s + 'a.gif';

		document.all['href'+myId].style.cursor = 'default';
		document.all['href'+act].style.cursor = 'hand';

		s = document.all['img'+act].src;
		l = s.length;
		s = s.substr(0,l-5);
		document.all['img'+act].src = s + '.gif';
		
		act = myId;
	}
	
styles();


	function mover(myId){
		s = document.all['img'+myId].src;
		l = s.length;
		s = s.substr(0,l-4);

		v = document.all['arr'+myId].src;
		l = v.length;
		v = v.substr(0,l-4);

		document.all['td'+myId].style.backgroundImage = 'url(images/m_but_.jpg)';
		document.all['arr'+myId].src = v + '_.gif';
		document.all['img'+myId].src = s + '_.gif';
	}

	function mout(myId){
		s = document.all['img'+myId].src;
		l = s.length;
		s = s.substr(0,l-5);

		v = document.all['arr'+myId].src;
		l = v.length;
		v = v.substr(0,l-5);
		
		document.all['td'+myId].style.backgroundImage = 'url(images/m_but.gif)';
		document.all['arr'+myId].src = v+'.gif';
		document.all['img'+myId].src = s+'.gif';
		
	}

	function mover_ban(myId){
		s = document.all['img'+myId].src;
		l = s.length;
		s = s.substr(0,l-4);
		
//background-color
		document.all['td'+myId].bgColor = '#ffffff';
		
		document.all['img'+myId].src = s + '_.gif';
	}

	function mout_ban(myId){
		s = document.all['img'+myId].src;
		l = s.length;
		s = s.substr(0,l-5);

		document.all['td'+myId].bgColor = '#EEEEEF';
		document.all['img'+myId].src = s+'.gif';
	}

function styles(){
document.write('<style>div.pro{display:none}</style>');
}

///////////////////////
function checkf() {
	a=checkf.arguments;
	form=a[0];
	noerror=true;
	for (i=1;i<a.length;i++) if (form[a[i]].value.length==0) noerror=false;
		if (!noerror) alert('Не заполены все требуемые поля!');
	return noerror;
}

function MM_findObj(n, d) { 
  	var p,i,x;  
	alert('sssssssss');	
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) 
		x=d.getElementById(n); 
	return x;
}

function ShowMail(user, domain1, domain2) {
	var email = user+'&#64;'+domain1+'&#46;'+domain2;
	if (ShowMail.arguments[3]) name = ShowMail.arguments[3];
	else name = email;
	document.writeln('<a href="mailto:'+email+'">'+name+'</a>');
}

function SendLink(link_name) {
	window.open("/send/?link="+link_name, "SendLink", "scrollbars=0, resizable=1, width=370, height=230").focus();
}


function MM_findObj(n, d) {
  	var p,i,x;  
	if(!d) d=document; 
	if((p=n.indexOf("?"))>0&&parent.frames.length) {
	    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);
	}
	if(!(x=d[n])&&d.all) x=d.all[n]; 
	for (i=0;!x&&i<d.forms.length;i++) 
		x=d.forms[i][n];
  	for(i=0;!x&&d.layers&&i<d.layers.length;i++) 
		x=MM_findObj(n,d.layers[i].document);
	if(!x && d.getElementById) 
		x=d.getElementById(n); 
	return x;
}



function openImage(src,nname) {
window.open("/popup.php?img="+src,"popupimage"+nname, "scrollbars=0, resizable=0").focus();
 }
 
function preload()
{
b=preload.arguments; 
preload_images = new Array();
for(i=0; i<b.length; i++)
	{
		preload_image = new Image;
		preload_image.src=b[i];
		preload_images[i]=preload_image;
	}
}



function menu_sw(x,name,turn) 
{
	td2=x.parentElement;
	tr=td2.parentElement;
	td1=tr.children(0);
	img=td1.children(0);
	img.src='/images/smenu/'+name+'_ico'+turn+'.gif';
}

function SetHiddenVar(variable,val) {
	var forma = document.forms['search'];
	forma.elements[variable].value = val;
	forma.submit();
	return false;
}

var options = Array();
function show_option(id){

 for(i in options) 
  {
 	document.all[i].style.display = 'none'; 
  }

 options[id] = 1;
 document.all[id].style.display = 'block';
 return false;
}

function scrolldivs(obj, i)
{
	leftdiv=MM_findObj('leftdiv'+i);
	topdiv=MM_findObj('topdiv'+i);
	leftdiv.scrollTop=obj.scrollTop;
	topdiv.scrollLeft=obj.scrollLeft;
}

function resizediv()
{
	if (ie==1)
	{
		i=1;
		br_cycle=0;
		do
   		{
   			topdivobj=MM_findObj('topdiv'+i);
			infodivobj=MM_findObj('infodiv'+i);			
			if (topdivobj&&infodivobj)
			{
				topdivobj.style.width=document.body.clientWidth-124-16-40; 
				infodivobj.style.width=document.body.clientWidth-124-40;
			}	
			else
				br_cycle=1;
			i++;
   		}
		while (br_cycle==0)	
	}
	else if (opera==1)
	{
		i=1;
		br_cycle=0;
		do
   		{
   			topdivobj=MM_findObj('topdiv'+i);
			leftdivobj=MM_findObj('leftdiv'+i);
			infodivobj=MM_findObj('infodiv'+i);			
			infodata=MM_findObj('infodata'+i);

			if (topdivobj&&infodivobj)
			{
				topdivobj.style.width=infodata.clientWidth;
				leftdivobj.style.height=infodata.clientHeight;
				infodivobj.style.width=infodata.clientWidth+16;
				infodivobj.style.height=infodata.clientHeight+16;
			}	
			else
				br_cycle=1;
			i++;
   		}
		while (br_cycle==0)
	}
}

function cartpopup(url)
{
	return window.open(url, "cart_window", "scrollbars=1, resizable=1, width=650, height=500").focus();
}

function popup(url)
{
	return window.open(url, "popup_window", "scrollbars=1, resizable=1, width=650, height=500").focus();
}
function rusoft() {
  window.open('http://www.rusoft.ru');
}

