
var crtColor="";

var MONTH_NAMES=new Array('January','February','March','April','May','June','July','August','September','October','November','December','Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');
var DAY_NAMES=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sun','Mon','Tue','Wed','Thu','Fri','Sat');

var selItem="1";

function expand(id)
{
	
	
	try
	{
		
		window.open("cat.php?ParentId="+id,	"ifmain");
		document.getElementById(selItem).style.color="#636363";
		document.getElementById(id).style.color="#0094FF";
		selItem= id;

	}
	catch(err2){}
	
}



function expandCat(id)
{
		
	try
	{
		if (document.getElementById("gr_"+id).style.display=="")
		{
			
			document.getElementById("gr_"+id).style.display="none";

			
		}
		else
			document.getElementById("gr_"+id).style.display="";

		
		
		
	}
	catch(err2){}
	
}





function sel(id)
{
	try
	{
			
		document.getElementById(id).style.color="#0094FF";
		
	}
	catch(err2){}

}

function unsel(id)
{
	try
	{
		if (selItem!=id)
		{
			document.getElementById(id).style.color="#636363";
		}
		
	}
	catch(err2){}

}


function selCat()
{
	try
	{
		
		event.srcElement.style.color="#ff9900";
	}
	catch(err2){}

}



function unselCat()
{
	try
	{
		event.srcElement.style.color="#ffffff";
	}
	catch(err2){}

}




function edititem(id,type,action)
{
	//type:  1= category,2=subcategory, 3= entry 
	//action:1=insert,   2=update,      3=delete 
	
	if (action==3)
	{
		if (!confirm("Sunteti sigur ca doriti sa stergeti recordul selectat ?"))
		{
			return;
		}
	}
	
	try
	{
	
		window.open("edit.php?ProdId="+id+"&type="+type +"&action="+action,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=500,height=350");	
		//window.showModalDialog("edit.php?ProdId="+id+"&type="+type +"&action="+action,"","dialogWidth:550px;dialogHeight:700px;center:yes;status:no;");
		

	}
	catch(err1)
	{
		window.open("edit.php?ProdId="+id+"&type="+type +"&action="+action,"_blank","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,copyhistory=no,width=500,height=350");	
	
		
	}
	

}


function count(i)
{
	try
	{
		window.open("count_click.php?id="+i,"ifaction");
		
		
	}
	catch (err1)
	{
	}

	
}
function resize_frame()
{
	frameHeight=document.getElementById("catmainTable").clientHeight;
	window.parent.document.getElementById("maintd").height=frameHeight;
}


