
function EditCategory(ID, hdnButtonName)
{
	AddCategory(ID, hdnButtonName);
}

function AddCategory(ID, hdnButtonName)
{
	/*
	var returnedValue = window.showModalDialog("popUp/IframePage.aspx?url=AddCategory.aspx?id=" + ID, "", "dialogHeight:200px; dialogWidth: 500px; status:0;help:no;");
	if (returnedValue == "Update")
	{
		var hdn = document.getElementById(hdnButtonName);
		if (hdn != null)
			eval(hdn.value);		
	}
	*/
	
	location = "PopUp/AddCategory.aspx?id=" + ID;
}	

function EditUser(ID, hdnButtonName, roleID)
{
	AddUser(ID, hdnButtonName, roleID);	
}

function AddUser(ID, hdnButtonName, roleID)
{
/*
	var returnedValue = window.showModalDialog("popUp/IframePage.aspx?url=AddUser.aspx?id=" + ID + "%26rid=" + roleID, "", "dialogHeight:390px; dialogWidth: 500px;status:0;help:no;");
	if (returnedValue == "Update")
	{
		var hdn = document.getElementById(hdnButtonName);
		if (hdn != null)
			eval(hdn.value);		
	}
*/
	location = "popUp/AddUser.aspx?id=" + ID + "&rid=" + roleID;
}
function SignIn()
{
	/*
	var returnedValue = window.showModalDialog("admin/popUp/IframePage.aspx?url=AddUser.aspx?id=0%26si=1", "", "dialogHeight:390px; dialogWidth: 500px;status:0;help:no;");
	if (returnedValue == "Update")
	{
		window.location = "login.aspx";	
	}
	*/
	location = "admin/popUp/AddUser.aspx?id=0&si=1";
}

function EditLocation(ID, hdnButtonName)
{
	AddLocation(ID, hdnButtonName);
}

function AddLocation(ID, hdnButtonName)
{
	/*
	var returnedValue = window.showModalDialog("popUp/IframePage.aspx?url=AddLocation.aspx?id=" + ID, "", "dialogHeight:380px; dialogWidth: 500px; status:0;help:no;");
	if (returnedValue == "Update")
	{
		var hdn = document.getElementById(hdnButtonName);
		if (hdn != null)
			eval(hdn.value);		
	}
	*/
	
	location = "popUp/AddLocation.aspx?id=" + ID;
}

function EditItem(ID, hdnButtonName, opt)
{
	AddItem(ID, hdnButtonName, opt);
}

function AddItem(ID, hdnButtonName, opt)
{
	/*
	var height;
	if (opt == 1)
		height = "640px";
	else
		height = "340px";
		
	var returnedValue = window.showModalDialog("popUp/IframePage.aspx?url=AddItem.aspx?id=" + ID, "", "dialogHeight:" + height + "; dialogWidth: 500px; status:0;help:no;");
	if (returnedValue == "Update")
	{
		var hdn = document.getElementById(hdnButtonName);
		if (hdn != null)
			eval(hdn.value);		
	}
	*/
	
	location = "popUp/AddItem.aspx?id=" + ID;
}

function EditSpecial(ID, hdnButtonName)
{
	AddSpecial(ID, hdnButtonName);
}

function AddSpecial(ID, hdnButtonName)
{
	/*
	var returnedValue = window.showModalDialog("popUp/IframePage.aspx?url=AddSpecial.aspx?id=" + ID, "", "dialogHeight:430px; dialogWidth: 500px; status:0;help:no;");
	if (returnedValue == "Update")
	{
		var hdn = document.getElementById(hdnButtonName);
		if (hdn != null)
			eval(hdn.value);		
	}
	*/
	location = "popUp/AddSpecial.aspx?id=" + ID;
}


function ViewOrder(ID, hdnButtonName)
{
	/*
	var DialogObject = new Object();
	DialogObject.Opener = window;

	var returnedValue =  window.showModalDialog("admin/popUp/IframePage.aspx?url=ViewOrder.aspx?id=" + ID, DialogObject, "dialogHeight:630px; dialogWidth: 700px; status:0;help:no;");	
	
	if (returnedValue == "Update")
	{
		var hdn = document.getElementById(hdnButtonName);
		if (hdn != null)
			eval(hdn.value);		
	}
	*/
	location = "admin/popUp/ViewOrder.aspx?id=" + ID;
}

function showExtras(obj, idTr)
{
	var obj1 = obj;
	var parent;
	while (obj1.parentNode.tagName != "TABLE")
	{
		obj1 = obj1.parentNode;
	}
	
	parent = obj1.parentNode;
		
	var trExtras = recursiveSearchID(parent.rows, idTr);
	
	if (trExtras != null)
	{
		if (trExtras.style.display == 'none')
			trExtras.style.display = 'block';
		else
			trExtras.style.display  = 'none';
	}
}

function recursiveSearchID(obj, id)
{
	for(var i=0; i<obj.length; i++)
	{
		if (obj[i].id == id)
			return obj[i];			
	}
}

function SetCssClassObjAndParent(obj, cls, parentCls)
{		
	obj.className = cls;
	obj.parentNode.className = parentCls;
}

function SetCssClassParentAndObj(obj, parentCls, cls)
{
	obj.className = parentCls;	
	if (obj.firstChild != null)
		obj.firstChild.className = cls;
}
