StaioneryWise = function() {

	orderMoreBox:null

    return {

        createTableEvents: function() {
            $$(".stationary-list-table th").invoke("stopObserving","click");
            $$(".stationary-list-table th").invoke("observe","click", this.columnSort.bindAsEventListener(this));
        },

        columnSort: function(e){
            var column = e.element(e).className.split(' ')[0];
            var table = e.element(e).up("table").id;
            var category = $("category").value;

            new Ajax.Request('xhr_sort_tables.php', {
                method:     'POST',
                parameters: 'column='+column+'&table='+table+'&category='+category,
                onSuccess: function(t) {
                    $(table).update(t.responseText);
                    this.createTableEvents();
                }.bind(this)
            });

        },

        showEndBox: function(text) {
            //Lightbox.showUrl({url:'../site_includes/end_box.php?text='+text,height:200});
			var alertBox = new Lightbox({
					id:'loginBox',
					width: 346,
					height: 236,
					url: '/site_includes/end_box.php?text='+text
					/*cb: function() {
						pyramidInit();
					}*/
				});
			alertBox.show();
        },
		needMoreLightbox: function(oid) {
            //Lightbox.showUrl({url:'../site_includes/end_box.php?text='+text,height:200});
			this.orderMoreBox = new Lightbox({
					id:'order-more',
					width: 250,
					height: 180,
					url: 'more_work.php?product_id='+oid
					/*cb: function() {
						pyramidInit();
					}*/
				});
			this.orderMoreBox.show();
			//orderMoreBox.hide();
			//setTimeout(function(){orderMoreBox.hide()},4000);
			//setTimeout("alert('hello')",2000);
        },
		orderArtworkLightbox: function(oid) {
            //Lightbox.showUrl({url:'../site_includes/end_box.php?text='+text,height:200});
			this.orderArtworkBox = new Lightbox({
					id:'order-artwork',
					width: 250,
					height: 180,
					url: 'order_art.php?product_id='+oid
					/*cb: function() {
						pyramidInit();
					}*/
				});
			this.orderArtworkBox.show();
        },
		loginWithEnter : function(e) {
			if(window.event) {
					  key = window.event.keyCode;     //IE
		
			 }    else {
					  key = e.which;     //firefox
			}
			if(key == 13) {
			sendForm();
			}
		}
    }



}();

document.observe( "dom:loaded", function() {
    StaioneryWise.createTableEvents();
});




var lightbox = new Lightbox({
    width:346,
    height:236
});