 function AskYesNo(url,question)
 {
 	var res;
	res=confirm(question);
	if(res)
		window.open(url, '_self');
 }
 
 function AskSubmit(question)
 {
 	var res;
	res=confirm(question);
	if(res) return true;
	else return false;
 }
 
 
function time_check(id,tc)
{
	var ta=document.getElementById('tia'+id);
	var tb=document.getElementById('tib'+id);
	var tf,t1,t2;
	t1=ta.value.split(':');
	t2=tb.value.split(':');
	if(tc) tf=ta; else tf=tb;
	if((t1[0]*60+t1[1]>t2[0]*60+t2[1])&&((t2[0]+0+t2[1])!=0))
	{
		tf.style.backgroundColor='#ff0000';
		tf.style.color='#ffffff';
	} else
	{
		ta.style.backgroundColor='#ffffff';
		tb.style.color='#000000';
		ta.style.backgroundColor='#ffffff';
		tb.style.color='#000000';

	}
}

function moveItem(id,dir)
{
	if((id==0)&&(dir<0)) return;
	var ta=document.getElementById('tia'+id);
	var tb=document.getElementById('tia'+(id+dir));
	var tmp;

	tmp=ta.value;
	ta.value=tb.value;
	tb.value=tmp;

	var ta=document.getElementById('tib'+id);
	var tb=document.getElementById('tib'+(id+dir));

	tmp=ta.value;
	ta.value=tb.value;
	tb.value=tmp;


	var ta=document.getElementById('name'+id);
	var tb=document.getElementById('name'+(id+dir));

	tmp=ta.value;
	ta.value=tb.value;
	tb.value=tmp;

	var ta=document.getElementById('sel'+id);
	var tb=document.getElementById('sel'+(id+dir));

	tmp=ta.value;
	ta.value=tb.value;
	tb.value=tmp;

}
