var attach_count = 0;
$(document).ready(function(){
//alert('123');
});

function num_Key(e) {
var key = (typeof e.charCode == 'undefined' ? e.keyCode : e.charCode);
if (e.ctrlKey || e.altKey || key < 32) return true;
key = String.fromCharCode(key);
return /[0-9]/.test(key);
}
function eng_num_Key(e) {
var key = (typeof e.charCode == 'undefined' ? e.keyCode : e.charCode);
if (e.ctrlKey || e.altKey || key < 32) return true;
key = String.fromCharCode(key);
return /[a-zA-Z0-9]/.test(key);
}


window.load = function()
{
	alert('r');
	$('op1') 
	.mouseover(function (){ 
		alert(1);
	    $(this).attr('op',$(this).css('opacity')); 
	    $(this).animate({opacity: 1}, 500 ); 
	}) 
	.mouseout(function (){ 
	    $(this).animate({opacity: $(this).attr('op')}, 500 ); 
	}); 
}

function hotEditDopTxt(i,itm, catid)
{
	var none 		= '<div style="color:silver;">&nbsp;����� ��� ������ �����������.</div>';
	var conteiner 	= document.getElementById("doptext"+i);
	var befedit 	= document.getElementById("befEditTxt"+i);
	
	if (none != conteiner.innerHTML) befedit.value = conteiner.innerHTML;
	
	var str  = '';
	str 	+= '<form action="/hots/" method="POST" target="frame1" id="form'+i+'">';
	str 	+= '<input type="hidden" name="commitupdahot" value="'+itm+'">';
	str 	+= '<input type="hidden" name="hot_catalog_id" value="'+catid+'">';
	str 	+= '<input style="width:415px; type="text" name="description" id="description" maxlength="100" value="'+befedit.value+'">';
	str 	+= '<input value="���������" type="button" onClick="hotEditDopTxtSave(\''+i+'\')">';
	str 	+= '<input type="button" value="������" onClick="hotEditDopTxtCancel('+i+')">';
	str 	+= '</form>';
	
	conteiner.innerHTML = str
	
	document.getElementById("btnehot"+i).style.display='none';
}

function hotEditDopTxtSave(i)
{
	document.getElementById('form'+i).submit();
	document.getElementById('befEditTxt'+i).value = document.getElementById('description').value
	hotEditDopTxtCancel(i);
}

function hotEditDopTxtCancel(i)
{
	var conteiner 	= document.getElementById("doptext"+i);
	var befedit 	= document.getElementById("befEditTxt"+i);
	
	conteiner.innerHTML = befedit.value == '' ? none : befedit.value;
	
	document.getElementById("btnehot"+i).style.display='';
}

var url;
var ico;
function goHreff()
{
	if (--ico == 0)
	window.location.href = url;
	document.getElementById('icco').innerHTML = ico;
	window.setTimeout('goHreff()',1000);
}
function elapse(hreff)
{
	url = hreff
	ico = 5;
	//document.write('<div id="icco"></div>');
	window.setTimeout('goHreff()',1000);
}

function printt(id)
{
	txt = document.getElementById(id).innerHTML;
	alert(txt)
	/*
	printwin = open('', 'printwin', 'width=300,height=300');
	printwin.document.open();
	printwin.document.writeln('<html><head><title></title><link href="/style/style.css" rel="stylesheet" type="text/css" /></head><body onload=print();close()>');
	printwin.document.writeln(txt);
	printwin.document.writeln('</body></html>');
	printwin.document.close();
	*/
}

function showColorTable()
{
	window.open("/colormap.html",
		"mywindow","menubar=1,resizable=1,width=600,height=500,scrollbars");
	//myWin= open("", "displayWindow", "width=500,height=400,status=yes,toolbar=yes,menubar=yes");
	
	// ������� ������ document ��� ����������� ������ 
	//myWin.document.open('/');
	
	// ������� �������� - (�� �� ����!)
	//myWin.document.close();  
}

function fullico(obj,t)
{
	if (t==1)
	{
		obj.style.position = 'absolute';
		obj.style.top = '';
		obj.style.width = '100px';
	}
	else
	{
		obj.style.position = 'relative';
		obj.style.top = '0px';
		obj.style.width = '20px';
	}
}

var color="Bold";
function blik(){  
  for (var i = 0; i < 20; i++){
    document.getElementById("addads").style.fontWeight=color;
  }
  if(color=="Bold")color="Normal";
  else color="Bold";
}
//setInterval("blik()",500);
