function sure(){
	return confirm('Are you sure? This action cannot be undone.');	
}

function req(el,msg){
	if(el.value == ""){
		alert(msg);
		el.className = 'required';
		el.focus();
		return false;
	}else{
		el.className = 'text';
		return true;
	}
}

function chkRadio(btn,msg) {
    var cnt = -1;
    for (var i=btn.length-1; i > -1; i--) {
        if (btn[i].checked) {cnt = i; i = -1;}
    }
    if (cnt > -1){
		//return btn[cnt].value;
		return true;
	}else{ 
		alert(msg);
		return false;
	}
}

function ajax_request(page){
	new Ajax.Request(page,{asynchronous:false,evalScripts:true});	
	return;	
}

function ajax_update_vars(el,page,vars){
	new Ajax.Updater(el,page,{asynchronous:false,parameters:vars,evalScripts:true});	
	return;
}

function popup(url,w,h){
    LeftPosition = (screen.width) ? (screen.width-w)/2 : 0;
    TopPosition = (screen.height) ? (screen.height-h)/2 : 0;
    
    childWindow=open(url, "", "toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width="+w+",height="+h+",left ="+LeftPosition+",top="+TopPosition+"");
    if (childWindow.opener == null) childWindow.opener = self;    
}
