// Martys cascade test
var idx = 0;
var xidx = 0;
var cascade = 0;
var cOffset = 23;
var cWins = new Array();

function openHelp(url) {
	openIframeWin(800,480,'<img src="/themes/yellowlighting/help.gif">說明視窗',url);
}

function openIframeWin(ajaxWidth,ajaxHeight,ajaxTitle,ajaxTarget) {
	if(idx < 5){
		foo = new Window('dialog'+xidx, {className: "yellowlighting", title: ajaxTitle, width:ajaxWidth, height:ajaxHeight, opacity:1, resizable: true, url: ajaxTarget, showEffectOptions: {duration:0} , hideEffectOptions: {duration:0} , wiredDrag: true});
		foo.setDestroyOnClose();
	    foo.showCenter(false,(24*xidx)+200);
	    foo.toFront();
	    cascade++;
	    idx++;
	    xidx++;
		cWins.push(foo);
	}
}

function closeAll() {
    var x = 0;
    var lag=20;
	for(var i=(cWins.length-1);  i>=0;  i--) {
	  setTimeout('cWins['+i+'].hide()',(x*lag));
	  x++;
	}
	setTimeout('cWins.length=0; idx=0; cascade=0;',x*lag);
}

function openAjaxAlert(ajaxOkLabel,ajaxTarget) {
Dialog.alert({url: ajaxTarget, options: {method: 'get'}},{className: "alphacube", width:540, okLabel: ajaxOkLabel});
}

window.onload=function(){
Nifty("div.item");
Nifty("div.list","big tr bottom");
Nifty("h3.list_title","top"); 
Nifty("div.widget","big bottom");
Nifty("h2.widget_title","big top");
Nifty("table.page_select");
Nifty("div.page_select");
Nifty("div.notice");
Nifty("div.helper");
Nifty("div.controller");
Nifty("div.stickie");
Nifty("form.data_form");
Nifty("label.field_title","small");

//auto-child-collapse
compactMenu('cat_list',true,'▽');
}