// JavaScript Document
function homeedit()
{
	parent.main.location.href = "./homeeditor.php";
}
function inquiriesdelete(id,page)
{
	if(confirm("Are you sure you want to delete the selected inquiry ?")){
		 parent.main.location.href = "./inquiriesdetail.php?event=delete&id=" + id + "&page=" + page;
	};
};
function inquiriesmark(id,read,page)
{
	parent.main.location.href = "./inquiriesdetail.php?event=mark&id=" + id + "&read=" + (read ? 1 : 0) + "&page=" + page;
}
function inquiriesdetail(id,page)
{
	parent.main.location.href = "./inquiriesdetail.php?id=" + id + "&page=" + page;
};
function categoriesdelete(id)
{
	if(confirm("Are you sure you want to delete the selected category ?\nAll nested products and categories will be deleted.")){
		 parent.main.location.href = "./categorieseditor.php?event=delete&id=" + id;
	};
}
function categoriesdetail(id)
{
	parent.main.location.href = "./products.php?id=" + id;
}
function categoriesadd(parent_)
{
	parent.main.location.href = "./categorieseditor.php?event=edit&id=0&parent=" + parent_;
}
function categoriesedit(id)
{
	parent.main.location.href = "./categorieseditor.php?event=edit&id=" + id;
}
function categoriesorder(id,order)
{
	if(order = prompt("Bigger number, higher priority. ( 0 ~ 999 )",order)){
		 parent.main.location.href = "./categorieseditor.php?event=order&id=" + id + "&order=" + order;
	};
}
function categoriesparent(id,parent_)
{
	if(parent_ = prompt("Enter the ID of the parent category :",parent_)){
		 parent.main.location.href = "./categorieseditor.php?event=parent&id=" + id + "&parent=" + parent_;
	};
}
function productshot(id,hot)
{
	if(!hot){
		 if(!confirm("Mark this product as \"Not hot\" ?")){
			  return false;
		 };
	}
	parent.main.location.href = "./productseditor.php?event=hot&hot=" + hot + "&id=" + id;
}
function productsadd(parent_)
{
	parent.main.location.href = "./productseditor.php?event=edit&id=0&parent=" + parent_;
}
function productsdetail(id)
{
	parent.main.location.href = "./productsdetail.php?id=" + id;
}
function productsedit(id)
{
	parent.main.location.href = "./productseditor.php?event=edit&id=" + id;
}
function productsdelete(id)
{
	if(confirm("Are you sure you want to delete the selected product?")){
		 parent.main.location.href = "./productseditor.php?event=delete&id=" + id;
	};
}
function productsorder(id,order)
{
	if(order = prompt("Bigger number, higher priority. ( 0 ~ 999 )",order)){
		 parent.main.location.href = "./productseditor.php?event=order&id=" + id + "&order=" + order;
	};
}
function productsparent(id,parent_)
{
	if(parent_ = prompt("Enter the ID of the parent category :",parent_)){
		 parent.main.location.href = "./productseditor.php?event=parent&id=" + id + "&parent=" + parent_;
	};
}
function showcart()
{
	win = window.open("cart.php","cart","width = 640, height = 540, toolbar = no, menubar = no, location = no, resizable = yes");
	win.focus();
};
function addtocart(id)
{
	win = window.open("cart.php?event=add&id=" + id,"cart","width = 640, height = 540, toolbar = no, menubar = no, location = no, resizable = yes");
	win.focus();
};
function removefromcart(id)
{
	alert(id);
};
function blankwindow(url)
{
	return window.open(url,"_blank","width = 640, height = 540, toolbar = no, menubar = no, location = no, resizable = yes, scrolling=yes");
};
function profilesorder(id,order)
{
	if(order = prompt("Bigger number, higher priority. ( 0 ~ 999 )",order)){
		 parent.main.location.href = "./profileseditor.php?event=order&id=" + id + "&order=" + order;
	};
};
function profilesedit(id)
{
	parent.main.location.href = "profileseditor.php?event=edit&id=" + id;
};
function profilesdelete(id)
{
	if(confirm("Are you sure ?")){
		 parent.main.location.href = "profileseditor.php?event=delete&id=" + id;
	};
};
function profileedit()
{
	parent.main.location.href = "profileeditor.php";
};
function faqsorder(id,order)
{
	if(order = prompt("Bigger number, higher priority. ( 0 ~ 999 )",order)){
		 parent.main.location.href = "./faqseditor.php?event=order&id=" + id + "&order=" + order;
	};
};
function faqsedit(id)
{
	parent.main.location.href = "faqseditor.php?event=edit&id=" + id;
};
function faqsdelete(id)
{
	if(confirm("Are you sure ?")){
		 parent.main.location.href = "faqseditor.php?event=delete&id=" + id;
	};
};
function newsdetail(id,page)
{
	parent.main.location.href = "newsdetail.php?id=" + id + "&page=" + page;
}
function newsedit(id,page)
{
	parent.main.location.href = "newseditor.php?event=edit&id=" + id + "&page=" + page;
};
function newsdelete(id,page)
{
	if(confirm("Are you sure want to delete the selected news?")){
		 parent.main.location.href = "newseditor.php?event=delete&id=" + id + "&page=" + page;
	};
};