alerddiv_stopped=0;
function alertd(debug_txt,debug_title,debug_color,debug_flow,debug_flow1){
	if(!admincheck||alerddiv_stopped)
		return;
	var titlealso=0;
	if(debug_color=='008800'||debug_color=='880088')
		titlealso=1;
	var added_id='';
	switch (debug_flow) {
		case 1:added_id='flow_';break;
		case 2:added_id='bigflow_';break;
		default:break;
	}
	var divid='alertddiv_'+added_id+scriptPage;
	var added_id1='';
	switch (debug_flow1) {
		case 1:added_id1='flow_';break;
		case 2:added_id1='bigflow_';break;
		default:break;
	}
	var divid1='alertddiv_'+added_id1+scriptPage;

	var rnd=Math.random();
	if(!document.getElementById('inner_'+divid)&&document.getElementById('somediv')){
		// POSITION BEGINS
		var w=0,h=0;
		var casevar=8;
		if(rnd>=0.00&&rnd<0.25){casevar=0;
		}else if(rnd>=0.25&&rnd<0.5){casevar=1;
		}else if(rnd>=0.5&&rnd<0.75){casevar=2;
		}else if(rnd>=0.75&&rnd<=1){casevar=3;}
		switch(casevar){
			case 0:w=10;h=10;break;
			case 1:w=10;h=410;break;
			case 2:w=1060;h=10;break;
			case 3:w=1060;h=410;break;
			default:w=10;h=10;break;
		}
		// POSITION ENDS
		divwin=dhtmlwindow.open(divid, 'div', 'somediv', 'Debug:'+divid, 'width=200px,height=200px,left='+w+'px,top='+h+'px,resize=1,scrolling=1');
	}
	if(debug_color=="") debug_color="000000";
	if(debug_title==undefined) debug_title="";
	else debug_title=debug_title+": ";
	if(document.getElementById('inner_'+divid)){
		document.getElementById('inner_'+divid).innerHTML=Math.floor(rnd*1000)+'.<b>'+((titlealso)?'<font style="color:#'+debug_color+'">':'')+debug_title+((titlealso)?'</font>':'')+'</b>'+'<font style="color:#'+debug_color+'">'+debug_txt+'</font><br>'+document.getElementById('inner_'+divid).innerHTML;
	}
	if(debug_flow1&&document.getElementById('inner_'+divid1)){
		document.getElementById('inner_'+divid1).innerHTML=Math.floor(rnd*1000)+'.<b>'+((titlealso)?'<font style="color:#'+debug_color+'">':'')+debug_title+((titlealso)?'</font>':'')+'</b>'+'<font style="color:#'+debug_color+'">'+debug_txt+'</font><br>'+document.getElementById('inner_'+divid1).innerHTML;
	}
}

function dbg(text){
	if(!admincheck)
		return;
	if(text=="")
		return;
	//var fso = new ActiveXObject( "Scripting.FileSystemObject" );
	//var s = fso.CreateTextFile("D:\\debug.dat", 1);
	//s.writeline(text);
	//s.writeline("-----------------------------");
	//s.Close();
}
