function GoToURL( url ) {

    location.href = url;
}


function SubmitToAction( obj, url ) {

    obj.action = url;
}


function SetTargetAndSubmitToAction( obj, url ) {

    obj.action = url;
    obj.target="_blank";
}


function PressSubmit( obj ) {

    obj.submit();
}


function ConfirmDelete() {

    if( confirm( "Would you like to delete this item?" ) ) {
    
        return true;
    }

    return false;
}

function ConfirmDelete() {

//    if( confirm( "Would you like to delete this item?" ) ) {
    
//        return true;
//    }

//    return false;
	return true;
}

function PrintErrorMsg( msgobj, msgtext ) {

    msgobj.innerHTML = msgtext;
    return false;
}


function CheckEmpty( targetobj, msgobj, msgtext ) {

    if( targetobj.value ) {
    
        return true;
    }
    
    PrintErrorMsg( msgobj, msgtext );
    window.scroll( 0, 0 );
    return false;
}


function CheckSelect( targetobj, msgobj, msgtext ) {

    for( i = 0 ; i < targetobj.length ; i++ ) {
    
        if( (targetobj[ i ].value > 0) && targetobj[ i ].selected ) {
        
            return true;
        }
    }

    PrintErrorMsg( msgobj, msgtext );
    window.scroll( 0, 0 );
    return false;
}


function OpenCalendar( FieldIDName ) {

    window.open( 'calendar.php?FieldIDName=' + FieldIDName, "", "resizable=no,scrollbars=no,status=no,width=250,height=250" );
    return true;
}


function AppendValueAndClose( targetobj, value ) {

    targetobj.value = value;
    window.close();
}


function OpenBarcode( Barcode ) {

    if(Barcode == "") return false;
    window.open( 'barcode.php?Code=' + Barcode, "", "resizable=no,scrollbars=no,status=no,width=220,height=150" );
    return true;
}
